[R] numerical derivative R help

Setlhare Lekgatlhamang SetlhareL at bob.bw
Wed Jul 7 14:19:54 CEST 2010


Which package are you using?

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Parminder Mankoo
Sent: Tuesday, July 06, 2010 10:50 PM
To: r-help at r-project.org
Subject: [R] numerical derivative R help
Importance: Low

I fit my CDF to sum of exponentials and now I want to take the numerical
derivative of this function to obtain probability density.I will really
appreciate your help reagrding the error messages I am getting which I
don't
understand.

*
*

> fitterma <- function(xtime) {

a <- -0.09144115

b <- -0.01335756

c <- -2.368057

d <- -0.00600052

return(exp(a+b*xtime)+exp(c+d*xtime))

}


> numericDeriv(fitterma,"xtime")


*Error in numericDeriv(fitterma, "xtime") : *

*  cannot coerce type 'closure' to vector of type 'double'*

*
*

*Thanks,*

*parmee*

	[[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



DISCLAIMER:\ Sample Disclaimer added in a VBScript.\ ...{{dropped:3}}



More information about the R-help mailing list