Skip to content
Prev 310856 / 398502 Next

R exponential regression

Hi

your model
f <- function(x,a,b) {a * I(x^b)}

can be expressed as

log(a)+b*log(x)

and for that it shall result in straight line and you can use lm for estimate of b and log(a)

It is also better to use 1:33 instead of 1980:2012

Based on values you get from linear realation you can set sensible starting values.
Formula: y ~ a * z^b

Parameters:
  Estimate Std. Error t value Pr(>|t|)    
a  0.13391    0.01848   7.248 3.74e-08 ***
b  2.22563    0.04140  53.763  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Residual standard error: 6.239 on 31 degrees of freedom

Number of iterations to convergence: 6 
Achieved convergence tolerance: 7.673e-07 

Regards
Petr