[R] Non-Linear Regression Problem

Douglas Bates bates at stat.wisc.edu
Wed Apr 14 18:29:17 CEST 2004


WilDscOp <wildscop at yahoo.com> writes:

> 	I was wondering if there is any way i could do a "Grid Search"
> on a parameter space using R (as SAS 6.12 and higher can do it) to
> start the Newton-Gauss Linearization least squares method when i have
> NO prior information about the parameter.
> 
> W. N. Venables and B. D. Ripley (2002) "Modern Applied Statistics with
> S", 4 th ed., page 216-7  has a topic "Self-starting non-linear
> regressions" using negexp.SSival - but i can not solve my hypothetical
> problem using that - my problem is :
> 
> 
> Y = EXP(-(THETA * t)) with data below for estimating THETA:
> 
> t    	Y
> 1	0.80
> 4 	0.45
> 16 	0.04
> 
> Whatever i could do, is in http://www.angelfire.com/ab5/get5/nonlinear.PDF
> 
> Any response / help / comment / suggestion / idea / web-link / replies
> will be greatly appreciated.
> 
> 
> Thanks in advance for your time.

> angel = read.table("/tmp/angelfire.dat", header = TRUE)
> angel
   t    Y
1  1 0.80
2  4 0.45
3 16 0.04
> lm(log(Y) ~ t - 1, angel)

Call:
lm(formula = log(Y) ~ t - 1, data = angel)

Coefficients:
      t  
-0.2012  

> fm = nls(Y~ exp(-(theta*t)), angel, c(theta = 0.2012), trace = TRUE)
0.0003229897 :  0.2012 
0.0003018397 :  0.2034108 
0.0003018337 :  0.2034484 
0.0003018337 :  0.2034489 
> summary(fm)

Formula: Y ~ exp(-(theta * t))

Parameters:
      Estimate Std. Error t value Pr(>|t|)    
theta 0.203449   0.006002   33.90  0.00087 ***
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 

Residual standard error: 0.01228 on 2 degrees of freedom




More information about the R-help mailing list