[R] Non-linear least squares

n.surawski nicholas.surawski at csiro.au
Mon Apr 2 02:31:38 CEST 2012


Greetings,

I am having some troubles with the nls() function in R V 2.14.2.  I am doing
some modelling where I want to predict the mass of leaf litter on the forest
floor (X) as a function of time since fire (t).  Fortunately, I have a
differential equation that I can fit to the data which is acceptable on
theoretical grounds.  It is: X(t) = (L/k)[1-exp(-kt)], where L is the litter
fall rate (t/ha/yr) and k is the decomposition rate (/yr).   I have two
problems:

(1) I have experimental error in both X and t.  Is there a way to take this
into account with nls?
(2) Is there a way to constrain the parameter estimates from nls?

For example, for a data snippet:
X =  4.6  4.1  4.7 11.0
t = 1.5 4.5 7.0 8.0
 
After I run nls I get:
L = 0.873
k = -0.059

The estimate for L is ok, but k (by definition) should be greater than 0. 

Is there a way around this?

Many thanks,

Nic Surawski.

--
View this message in context: http://r.789695.n4.nabble.com/Non-linear-least-squares-tp4524812p4524812.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list