Re: [R] look for help on nlm in R

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Sun 10 Jul 2005 - 01:51:38 EST

>>>>> "MaggieZ" == Zhu, Maggie <maggie.zhu@pioneer.com>
>>>>> on Thu, 7 Jul 2005 14:40:37 -0500 writes:

    MaggieZ> I had a hard time in learning nlm in R and appreciate any help.

    MaggieZ> I encounted the following error message from time
    MaggieZ> to time when I tried different starting parameter
    MaggieZ> values (three parameter values in this case) in

     >>  nlm(f=SS.fun,p=c(0.1/40,0.1,2),hessian = FALSE,N.measure=object,h=20) 

     Error in f(x, ...) : only 0's may mix with negative subscripts 

    MaggieZ> Basically I know the three parameter values should all be positive numbers. So, how to select appropriate starting parameter values to prevent this kind of error message?

Maggie, it's a bug in the 'SS.fun' function that you are asking nlm() to minimize. So it would be best to show us your SS.fun().

BTW: "subscripts" are the `` i '' in x[i]

      in its the subscripts that become wrong in your SS.fun function.

Regards,
Martin Maechler, ETH Zurich



R-help@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 Received on Sun Jul 10 01:57:15 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:27 EST