Skip to content

Res: fitting "power model" in nls()

4 messages · Milton Cezar Ribeiro, Gabor Grothendieck

#
OK.  Since the model is linear except for A lets use brute force to
repeatedly evaluate the sum of squares for values of A between
-2 and 2 proceeding in steps of .01 solving the other parameters using
lm. That will give us better starting values and we should be able to
use nls on that.
[1] -0.45
Nonlinear regression model
  model:  richness ~ Const + B * (area^A)
   data:  parent.frame()
   Const        B        A
 33.9289 -33.4595  -0.4464
 residual sum-of-squares: 8751

Number of iterations to convergence: 2
Achieved convergence tolerance: 3.368e-06

Note that our A value is suspiciously close to A = -0.5 and sqrt(area)
is length so I wonder if there is an argument based on units of
measurement that might support a model of the form:

richness = Const + B / sqrt(area)
On Dec 2, 2007 3:39 PM, Milton Cezar Ribeiro <milton_ruser at yahoo.com.br> wrote:
#
Also the fitted values satisfy Const = -B = 33 (approximately) so we could try:
Nonlinear regression model
  model:  richness ~ C * (1 - 1/sqrt(area))
   data:  parent.frame()
    C
32.85
 residual sum-of-squares: 8764

Number of iterations to convergence: 1
Achieved convergence tolerance: 5.595e-10

        
On Dec 2, 2007 4:06 PM, Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
#
I played around with this a bit more and noticed that the "plinear"
algorithm of nls converged using nearly every starting value I tried.  In fact
A = 0 was the only starting value that I could find that did not converge.
Note that with "plinear" you only specify the starting values for non-linear
parameters, in this case A, while the unnamed linear parameters are implied
as coefficients of the columns of the matrix defined in the rhs.
Nonlinear regression model
  model:  richness ~ cbind(1, area^A)
   data:  parent.frame()
       A    .lin1    .lin2
 -0.4464  33.9290 -33.4595
 residual sum-of-squares: 8751

Number of iterations to convergence: 6
Achieved convergence tolerance: 4.968e-07
On Dec 2, 2007 4:06 PM, Gabor Grothendieck <ggrothendieck at gmail.com> wrote: