I would like to extrapolate time series using exponential curve while getting the parameters via linear regression.
Exponential curve is given as $g=e^{~a + b \cdot t}$. Since I want to use linear regression, I transformed it as $ln(g) = a + b \cdot t$.
My observations are (written as R vectors)
t <- c(3,4,5,6,7,8,9,10,11)
g <- c(1.038459504,1.019448815,1.017729187,1.010076583,1.00895011,1.007841198,+
+1.006566597,1.009939696,1.003751382)
I omitted values for t = 1, 2 as they were way too different. It should be smooth.
Here comes my solution. I should probably regress $ln(g)$ against $t$. $ln(g)$ is
lng<-c(0.037738369, 0.019262104, 0.017573858, 0.010026152, 0.008910295+
+0.007810615, 0.006545131, 0.009890622, 0.003744363)
The output of linear model lm(lng~t)
in R is
lm(formula = lng ~ t)
Coefficients:
(Intercept) t
0.035476 -0.003139
Now, I would expect to simply put ln(g) = 0.037571 - 0.003477*t
, which means g = e^(0.037571 - 0.003477*t)
for t > 11
in order to get the extrapolated values, but it's weird. lm(g~t)
is giving me better output.
I believe that I need to get $a$ and $b$ firstly and then I can predict values. The result is a=-2.390289,b=-0.326016
. I just don't know how to get it.
Best Answer
Linear regression in log-log coordinates leads to the result shown below :