[R] Nested error structure in nonlinear model

Murray Jorgensen maj at stats.waikato.ac.nz
Sat Apr 1 06:58:36 CEST 2006


I am trying to fit a nonlinear regression model to data. There are 
several predictor variables and 8 parameters. I will write the model as

Y ~ Yhat(theta1,...,theta8)

OK, I can do this using nls() - but "only just" as there are not as many 
observations as might be desired.

Now the problem is that we have a factor "Site" and I want to include a 
corresponding error component. I tried something like (excuse the 
doctored R output):

 > mod0.nlme <-  nlme(Y ~ Yhat(theta1,...,theta8) + site.err ,
+                    start = c(mod0.st,0),
+                    groups = ~ Site,
+                   fixed = theta1 + ... + theta8 ~ 1,
+                   random = site.err ~ 1)
Error in nlme.formula(Y ~ Yhat(theta1,...,theta8  :
         starting values for the fixed component are not the correct length

and then

 > mod0.nlme <-  nlme(Y ~ Yhat(theta1,...,theta8) + site.err ,
+                    start = mod0.st,
+                    groups = ~ Site,
+                   fixed = theta1 + ... + theta8 ~ 1,
+                   random = site.err ~ 1)
Error: Singularity in backsolve at level 0, block 1

The straightforward way would be to go

 > mod0.nlme <-  nlme(Y ~ Yhat(theta1,...,theta8) ,
+                    start = mod0.st,
+                    groups = ~ Site,
+                   fixed = theta1 + ... + theta8 ~ 1)

making all 8 parameters random, but there is little hope of getting that 
to work. (I did try it and it does not crash straight away but settles 
down to run forever.)

Any comments welcome. I regret that I cannot go into much detail about 
the actual problem.

-- 
Dr Murray Jorgensen      http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: maj at waikato.ac.nz                                Fax 7 838 4155
Phone  +64 7 838 4773 wk    Home +64 7 825 0441    Mobile 021 1395 862




More information about the R-help mailing list