Skip to content
Prev 11326 / 20628 Next

Formula and Start-values Any help at all?… Self-contained example

Dear list,
I still have no idea how to specify or give start values for vectors in a formula for nlmer()
The technique works fine for an approximate method I use in lmer()
(That technique depends heavily on some scaling of variables.)

Here is a self-contained example using some mock data whose origin is described.

I always get one of these two errors when trying to specify the nlmer() model
Error in nlmer(ylong ~ xinter(a, xlong, x0.est) ~ (a | species) + (x0.est |  : 
  not all parameter names are used in the nonlinear model expression
or
Error: s > 0 is not TRUE

Can  I get any help on formula specification or start values?
I have coded in a function with derivatives using deriv() .
+    ytemp =  scale(yun[,i], center=F) # get ytemp to define scaling factor
+    y[,i] =  ytemp   # scale
+    ysc[i] = attributes(ytemp)$`scaled:scale`
+    asc[i] = 1/ysc[i]    # useful version of a to relate scaled quantities
+ }
+                     function.arg=c("a","xlong","x0.est"))
+      start=start.vec,  data=trial.dat  )
Error in nlmer(ylong ~ xinter(a, xlong, x0.est) ~ (a | species) + (x0.est |  : 
  not all parameter names are used in the nonlinear model expression
+      start=start.vec,  data=trial.dat  )
Error: s > 0 is not TRUE

Notes -- how R defines start.vec...
[1]  0.16  0.16 20.00 20.00
a1      a1000    x0.est1 x0.est1000 
      0.16       0.16      20.00      20.00