0
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Don't know if this will help much, but I don't get those values for $\ln g$ at all. My first few numbers are 0.0377384, 0.0192621, 0.0175739.... $\endgroup$ – tabstop Feb 15 '14 at 18:07
  • $\begingroup$ Because in r you use the lm function as lm(thing you want to predict ~ variables) also if it is a log fit then why not use ln(g)~ intercept + t since r will do the rest for you? Ps I am using a phone hence no formatting ;) $\endgroup$ – Chinny84 Feb 15 '14 at 18:08
  • $\begingroup$ tabstop: my bad, it's edited now.___ @Chinny84: what do you mean? $\endgroup$ – emilio Feb 15 '14 at 18:47
1
$\begingroup$

Linear regression in log-log coordinates leads to the result shown below :

enter image description here

$\endgroup$
  • $\begingroup$ Well, I'm not looking for the best fit of data, i.e. g=exp(a+b*t) has to be used. I know models with bigger oefficient of determination - I just want to know how to get a and b from regression coefficients and plot these data using that particular exponential curve. $\endgroup$ – emilio Feb 15 '14 at 18:54
0
$\begingroup$

When I plot your data after taking the log, I get $ln g = 0.0355-0.0031 t$ as the best fit. It doesn't look too good. The chart is from Excel. Your values for $\ln g$ are not correct.

enter image description here

$\endgroup$
  • $\begingroup$ You are right with me having ln g wrong. I have just edited that. However, you have plot linear trend, not the exponential curve. It is necessary to transform intercept and t coefficient into a and b in order to plot that curve, I just don't know how. $\endgroup$ – emilio Feb 15 '14 at 18:45
  • $\begingroup$ As I had taken the logs, I did a linear fit. That corresponds to an exponential curve befire the logs. $\endgroup$ – Ross Millikan Feb 15 '14 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.