Finding the least square method for an exponential function

718 Views Asked by At

Given:

Data: \begin{matrix} x & y \\ 1 & 37 \\ 2 & 36.25 \\ 3 & 35.41 \\ 4 & 34.91 \\ 5 & 34.52 \\ 6 & 34.45 \\ 7 & 34.4 \\ 8 & 34 \\ 9 & 33.62 \\ 10 & 33.9 \\ \end{matrix} The model we are expected to use: $$EY=\alpha_{0}e^{-\alpha_{1}x}$$ Task:

a) linearize the model with the least square method

b) Give a 95% confidence interval for $\alpha_{0}$ and interpret the result.

Solution: \begin{matrix} x & y & Y & xY & x^2 \\ 0.00 & 37.00 & 3.61 & 3.61 & 1.00 \\ 1.00 & 36.25 & 3.59 & 7.18 & 4.00 \\ 2.00 & 35.41 & 3.57 & 10.70 & 9.00 \\ 3.00 & 34.91 & 3.55 & 14.21 & 16.00 \\ 4.00 & 34.52 & 3.54 & 17.71 & 25.00 \\ 5.00 & 34.45 & 3.54 & 21.24 & 36.00 \\ 6.00 & 34.40 & 3.54 & 24.77 & 49.00 \\ 7.00 & 34.00 & 3.53 & 28.21 & 64.00 \\ 8.00 & 33.62 & 3.52 & 31.64 & 81.00 \\ 9.00 & 33.90 & 3.52 & 35.23 & 100.00 \\ \end{matrix}

$$EY=\alpha_{0}e^{-\alpha_{1}x}$$ $$\ln EY=\ln a_{0}-x\ln a_{1}$$

I am not sure if I should switch something here: $$A=\ln a_{1}$$ $$B=\ln a_{0}$$

\begin{matrix} A \sum x + n B = \sum Y \\ A \sum x^{2} + B \sum x = \sum x Y \\ \end{matrix}

From our system, we get: $$A= \frac{\sum Y - n B}{\sum x}$$ $$B = \frac{\sum x \sum x Y - \sum Y \sum x^{2}}{\sum x \sum x - \sum x^{2}n} = 3.60264$$ $$A=-0.0094$$ $$B = \ln a_0 = 3.60264 \Longrightarrow e^{3.60264} = a_0 $$ $$A = \ln a_1 = 0.9905$$

and the result is: $$36.7953 e^{-0.9905x}$$

Our result is very bad, so I must be making a mistake somewhere

\begin{matrix} result \\ 13.37 \\ 4.87 \\ 1.78 \\ 0.65 \\ 0.24 \\ 0.09 \\ 0.03 \\ 0.01 \\ 0.00 \\ 0.00 \end{matrix}

Question:

What am I doing wrong? What is the answer?

Edit

for $$a1 = 0.0094$$ $$a0 = 36.69532469448542$$

The results are realistic:

[array([36.35200477]), array([36.01189694]), array([35.67497114]), array([35.34119761]), array([35.01054684]), array([34.68298963]), array([34.35849703]), array([34.03704038]), array([33.71859125]), array([33.40312152])]

This is correct:

$$B = \ln a_0 = 3.60264 \Longrightarrow e^{3.60264} = a_0=36.694981432443825 $$

I have considered that these are wrong:

$$A = \ln a_1 = 0.9905$$

How it should be: $$a_1 = -A = 0.009479410327687468$$

1

There are 1 best solutions below

0
On BEST ANSWER

Note that $\ln \mathbb{E}[Y\mid X=x] = \ln \alpha_0 - \alpha_1x = \beta_0 + \beta_1x $. Hence you estimate $\hat{\beta_0} = \ln \alpha_0 $, so $\hat{\alpha}_0 = e^{\hat{\beta_0}}$ and $\hat{\beta}_1 = - \hat{\alpha}_1$, i.e., $ - \hat{\beta}_1 = \hat{\alpha}_1$.

Note that the predicted values will be biased, hence you should consider to use the estimated values as initial values in a non-linear regression estimation.