[R] R exponential regression

muzammil786 m.shahbaz at sheffield.ac.uk
Wed Nov 14 12:11:59 CET 2012


I am having a similar problem on this data (given below). I have tried
several starting values for a and b, but it is consistently giving me: 

fm <- nls(y~f(x,a,b), data.frame(x,y), start=c(a=1,b=1)) 
Error in numericDeriv(form[[3L]], names(ind), env) : 
  Missing value or an infinity produced when evaluating the model

The function f(x,a,b) is defined here: 
f <- function(x,a,b) {a * I(x^b)} 

The data is given here: 

      x   y 
1  1980   1 
2  1981   1 
3  1982   1 
4  1983   3 
5  1984   3 
6  1985   5 
7  1986   8 
8  1987   8 
9  1988   9 
10 1989  12 
11 1990  15 
12 1991  24 
13 1992  33 
14 1993  44 
15 1994  62 
16 1995  68 
17 1996  81 
18 1997  87 
19 1998 102 
20 1999 114 
21 2000 123 
22 2001 135 
23 2002 144 
24 2003 158 
25 2004 172 
26 2005 188 
27 2006 197 
28 2007 224 
29 2008 234 
30 2009 254 
31 2010 278 
32 2011 312 
33 2012 317

I shall be grateful if you could guide me what's wrong here. 

Cheers. 
Muzammil



--
View this message in context: http://r.789695.n4.nabble.com/R-exponential-regression-tp1009449p4649474.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list