[R] Fitting 2D vs. 2D data with nls()

Timur Elzhov Timur.Elzhov at jinr.ru
Fri Dec 6 17:32:03 CET 2002


Dear R-experts!

I have y(x) data, dim(y) == dim(x) == c(2000, 2)
I'd like to fit them with nls:

fit.result <- nls ( y ~ f(x, p1, p2, p3),
                    start = list(p1 = ... , p2 = .. , p3 = ..)
                  )

Actually I want to fit y[,1] ~ x[,1] and y[,2] ~ x[,2]
*simulaneously*, with the same parameters set {p1, p2, p3}.

I tried to feed R tha above formula, R errors with:
>>  Error in qr.qty(QR, resid) : qr and y must have the same number of rows

I'm sorry, but I don't understand anything about 'qr'.. :-(


So, is it posiible to decide my problem with nls()?
with other fitting function?


Thanks a lot,
Timur.




More information about the R-help mailing list