Suchandra Thapa <[EMAIL PROTECTED]> writes:

> I'm running into problems trying to use the nls function to fit the some
> data.  I'm invoking nls using 
> 
> nls(s~k/(a+r)^b, start=list(k=1, a=13, b=0.59))
> 
> but I get errors indicating that the step has been reduced below the
> minimum step size or an inifinity is generated in numericDeriv. I've
> tried to use a variety of starting values for a, b, k but get similar
> errors.  
> 
> Is there anything I can do to get the a fit or is there an alternative
> to the nls function?

Well, first you plot the data and see if the relationship between r
and s is sufficiently well defined to estimate three parameters in a
nonlinear model.  It is common to try to estimate more parameters than
can reasonably be determined from the data.

Secondly, the parameter k is conditionally linear so you can try
fitting the model as

 nls(s ~ 1/(a+r)^b, start = list(a = 13, b = 0.59), alg = 'plinear',
   trace = TRUE)

I recommend using trace = TRUE on difficult problems so you can see
exactly where the iterations are going.

If that shows unstable behavior then try to determine how the model is
collapsing.  In particular, what is happening to the value of a?
-- 
Douglas Bates                            [EMAIL PROTECTED]
Statistics Department                    608/262-2598
University of Wisconsin - Madison        http://www.stat.wisc.edu/~bates/

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to