Dear list,
Hi,
I am trying to get the second derivative of a logistic formula, in R summary
the model is given as :
###
>$nls
>Nonlinear regression model
>model: data ~ logistic(time, A, mu, lambda, addpar)
>data: parent.frame()
> A mu lambda
>0.53243 0.03741 6.94296
###
but I know the formula used is
# y~'A'/(1+exp((4*'mu'/'A')*('lambda'-'time'))+2)) # from the grofit (
package I am using to fit the model) documentation.
I have attempted to use the R function 'deriv' to get the
first derivative from which I can then reuse the deriv function to get the
second derivative.... unfortunately this does not seem to work
###
>express<-expression(y~'A'/(1+exp((4*'mu'/'A')*('lambda'-'time'))+2))
> express
expression(y ~ "A"/(1 + exp((4 * "mu"/"A") * ("lambda" - "time")) +
2))
>
> d1<-deriv(express)
Error in deriv.default(express) : element 2 is empty;
the part of the args list of '.Internal' being evaluated was:
(expr, namevec, function.arg, tag, hessian)
####
Why is this not working and how do I get the second derivative?
Thank you for reading my post, all help is appreciated,
Kitty
[[alternative HTML version deleted]]