[R] curve fitting problem

From: <pieterprovoost_at_gmail.com>
Date: Mon, 24 Dec 2007 09:04:09 -0500


I'm trying to fit a function y=k*l^(m*x) to some data points, with reasonable starting value estimates (I think). I keep getting "singular matrix 'a' in solve".

This is the code:

ox <- c(-600,-300,-200,1,100,200)
ir <- c(1,2.5,4,9,14,20)
model <- nls(ir ~ k*l^(m*ox),start=list(k=10,l=3,m=0.004),algorithm="plinear") summary(model)
plot(ox,ir)
testox <- seq(-600,200,length=100)

k <- 10
l <- 3
m <- 0.004

testir <- k*l^(m*testox)
lines(testox,testir)

Any thoughts?
Thanks!

--
This message was sent on behalf of pieterprovoost_at_gmail.com at openSubscriber.com
http://www.opensubscriber.com/messages/r-help@stat.math.ethz.ch/topic.html

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 24 Dec 2007 - 14:14:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 24 Dec 2007 - 16:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.