HI, i have some prob when i try to use nls(). my data is 1D vector, I tried to use a polynomial function(order is 3) to fit it. the data series is stored in x. the a0, a1, a2, a3 below is coefficient, which i hope i can get from calls "nls"> z <- nls( ~ a0 + a1 * x + a2 * x * x + a3 * x * x * x, data = x )Error in match.call(definition, call, expand.dots) : .Primitive... is not a function Any idea on what is the problem? many thanks, yan
On 16 Jan 2003 at 22:15, Yan Yu wrote:> HI, > i have some prob when i try to use nls(). > my data is 1D vector, I tried to use a polynomial function(order is 3) to > fit it. > the data series is stored in x. > the a0, a1, a2, a3 below is coefficient, which i hope i can get from > calls "nls" > > > z <- nls( ~ a0 + a1 * x + a2 * x * x + a3 * x * x * x, data = x )You haven't given a response in the formula? nls could possibly give a more informative error message. Kjetil Halvorsen> Error in match.call(definition, call, expand.dots) : > .Primitive... is not a function > > Any idea on what is the problem? > > many thanks, > yan > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Hello, I want to estimate parameters of the model y=a/x with x=1:10 and y=3/x. I tested the NLS function. Could you tell me why it doesn't converge ? Regards, Gr?gory Benmenzer> x=1:10 > y=3/x > nls(y~a/x, start=list(a=2), control=nls.control(maxiter=100))Error in nls(y ~ a/x, start = list(a = 2), control = nls.control(maxiter = 100)) : number of iterations exceeded maximum of 100>