[R] strategies to obtain convergence using nlme

Spencer Graves spencer.graves at pdf.com
Sun Nov 20 17:42:59 CET 2005


	  A message like "Singular precision matrix in level -1, block 1" 
usuallly means that the paramters have drifted into a region where the 
log(likelihood) is insensitive to changes in some linear combination of 
the parameters.  In other words, the system is overparameterized, at 
least for that case, and nlme is unable to find unique estimates.

	  If it were my problem, I might try to trace through the code line by 
line.  For many functions, simply typing the function name at a command 
prompt will produce a listing of the function.  In this case, however, 
we get the following:

 > nlme
function (model, data = sys.frame(sys.parent()), fixed, random = fixed,
     groups, start, correlation = NULL, weights = NULL, subset,
     method = c("ML", "REML"), na.action = na.fail, naPattern,
     control = list(), verbose = FALSE)
{
     UseMethod("nlme")
}

	  This is not instantly helpful.  To get to the next step, I requested 
the following:

 > methods("nlme")
[1] nlme.formula nlme.nlsList

	  Then typing "nlme.formula" and "nlme.nlsList" at a command prompt 
gave me listing of those two functions.  If the argument "model" has 
class "formula", it uses nlme.formula;  if the class of "model" is 
"nlsList", it uses nlme.nlsList.

	  Hope this helps.
	  spencer graves

Bill Shipley wrote:

> Hello.  I am working on an analysis involving the nonlinear mixed model
> function (nlme) in R.  The data consist of measures of carbon fixation
> by leaves as a function of light intensity and the parametric function
> (standard in this area because it has a biological interpretation) is a
> non-rectangular hyperbola.  I cannot get the nonlinear mixed model
> (nlme) function to converge cleanly. I am hoping that others have found
> strategies for getting starting values that might solve this problem.  I
> have a request (below), some details of the problem, and then a question
> (at the end of this posting).
> 
>  
> 
> Request 1:  Any documents that you can point to would be welcome,
> especially if they involve a non-rectangular hyperbola.  I have already
> searched the archives and have read the book by Pinheiro & Bates (2000)
> and, although they give many useful suggestions, none seem to work in my
> case.  
> 
>  
> 
> Details: 
> 
>  
> 
> In particular, I can obtain convergence for each group (plant)
> separately using either nls or nlsList, but cannot get convergence using
> nlme.
> 
>  
> 
> My function is a non-rectangular hyperbola with 4 parameters (theta, Am,
> alpha, Rd):
> 
>  
> 
> #Nonrectangular hyperbola for photosynthesis
> 
> # myfunct
> 
> (1/(2*theta))*(
> 
> alpha*Irr + Am -sqrt((alpha*Irr+Am)^2-4*alpha*theta*Am*Irr))-Rd
> 
>  
> 
> I have written a self-starting function (NRhyperbola) to provide
> starting values. This self-starting function works.  When I use this
> self-starting function with nlsList using a data set with the grouping
> variable (and after removing a few groups for which there is an
> insufficient range of the independent variable to provide estimates), I
> get convergence and reasonable estimates.  Similarly if I use nls
> separately for every group I obtain reasonable estimates of the 4
> parameters.
> 
>  
> 
> If I then use the fixed effect values from nlsList (i.e. the average
> value of each parameter over the groups) to do a nonlinear mixed model
> (nlme) using the fixed effects estimates from nlsList, I fail to
> converge after 50 iterations and get two types of  warning:
> 
>  
> 
> (1): "NaNs produced in: sqrt(.expr10)"  - this is because the parameter
> values drift into regions in which the sqrt in the function is
> undefined.
> 
>  (2) "Singular precision matrix in level -1, block 1". - I do not know
> what this warning means.
> 
>  
> 
> I have tried many different changes in the starting values and none
> work.
> 
>  
> 
> Question: what does the second warning mean?
> 
>  
> 
> Thanks for any help.
> 
>  
> 
> Bill Shipley
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915




More information about the R-help mailing list