Find parameters for curve fitting (simple linear regression involved?)

152 Views Asked by At

I would like to fit data in g~t scatterplot, where

g <- c(1.038459504,1.019448815,1.017729187,1.010076583,1.00895011,1.007841198,+
       +1.006566597,1.009939696,1.003751382)
t <- c(3,4,5,6,7,8,9,10,11)

with g=exp(a+b*t) curve. How can I estimate a and b using linear regression?

The solution from handbook is a=-2.390289, b=-0.326016, R^2 = 0.88644 and g = 1 + exp(-2.390289 - 0.326016*t), which gives fairly good estimations (you can see on this graph that this curve seems to be good at fitting data above).

I have not a clue how they compute a and b and why it is g=1+exp(a+b*t) now. Any idea? I suppose it has something to do with transformation into (ln g) = a + b*t in order to regress the data.

PS: I did ask quite a similar question yesterday, but now it should be more clear what I want to figure out.

2

There are 2 best solutions below

2
On

My results, with all détails :

enter image description here

2
On

There is no reason for this extra $1$. Just start again : you want to fit $g=e^{a+b x}$ which non linear. You properly make the transform $\log (g)=a+b x$ which is linear. So, a linear regression provides the value of $a$ and $b$ for the linearized model. Use these values as initial estimates for the fit of $g=e^{a+b x}$ starting from scratch.

May be they changed the model to $g=1+e^{a+b x}$ because all your numbers are close to $1$. If this is the case, then the linear model should be $\log (g-1)=a+b x$.