[R] nls and four parameter estimates

Onoriode.Coast at csiro.au Onoriode.Coast at csiro.au
Tue Jun 2 04:54:03 CEST 2015


Hello all!

I am trying to estimate four parameters (mu, sigma, theta and lambda) of a model
Using the nls package in R, I can only get it to work if I limit the number of parameters to be estimated to three (i.e. mu, sigma and theta) as in the first model - mod1 - below. Including a fourth parameter (lambda) like in the second model - mod2 - returns the following error messages

1.       Error in numericDeriv(form[[3L]], names(ind), env):

2.       Missing value or an infinity produced when evaluating the model

mod1<-nls(germ~1-(exp(-1*((psi-(theta/time)-mu)/sigma))),start=c(mu=-2.7, theta=3, sigma=3), data=ht)
mod1

mod2<-nls(germ~1-(exp(-1*((psi-(theta/time)-mu)/sigma)^lambda)),start=c(mu=-2.7, theta=3, sigma=3, lambda=-1.2), data=ht)
mod2

Please have a look at my code and tell how I might get it to work. A sample of my data is shown below. It has five levels of psi (0, -0.4, -0.8, -1.2 and -1.6).

psi

time

germ

0

1.333333

0

0

1.416667

0

0

1.5

0.04

0

1.583333

0.04

0

2.083333

0.08

0

2.166667

0.16

0

2.25

0.24

0

2.583333

0.64

0

2.666667

0.72

0

2.916667

1

.
.
.
-1.6

2.916667

0

-1.6

3.166667

0

-1.6

3.666667

0

-1.6

7.666667

0

-1.6

9.666667

0

-1.6

12.66667

0

-1.6

19.66667

0


Dr Onoriode Coast
Postdoctoral Fellow
Agriculture Flagship
CSIRO
E onoriode.coast at csiro.au T +61 2 6799 1541 M 0477 386 110
21888 Kamilaroi Highway, Narrabri, NSW, 2390 Australia
www.csiro.au

	[[alternative HTML version deleted]]



More information about the R-help mailing list