# Least squares with exponential model

I'm trying to fit values from this model $$y(x)=ae^{−bx}+c$$

where a, b and c are 3 different parameters that I want to find with least squares. So using least squares I want to find the value of a, b and c using this formula

$$\mathrm{argmin}\sum_i \left( ae^{−bx_i}+c - y_i \right)^2.$$

This leads me to 3 non linear equations after partial derivation of the previous one with respect a, b and c. Surely there are already the general formula for this case but I cannot find them. Can anybody help me?

• As far as I know what you have is the general formula. For non-linear regressions, closed formed solutions often do not exist, so they are solved numerically using the minimization function and a gradient function if available (which it sounds like you already have). Obviously if you put the $c$ coefficient in the exponents or removed it you could log both sides and do OLS on that. May 11, 2015 at 0:45
• Domenico, exactly as in my answer to your earlier question there is no closed form formula for the solutions of these equations, Again they have to be obtained by iterative calculations. May 11, 2015 at 0:53
• Since this question presents the issue more clearly than your other question, you might consider editing the manner of presenting the information here into your other question. It would improve it quite a lot. May 11, 2015 at 1:00

In this 3 parameter form ($E(y)=ae^{−bx}+c$), your question has a nice simple structure that can be exploited.

In particular, if you condition on $b$, and let $z_i=e^{-bx_i}$, you have

$E(y|b)=az+c$ and need to find the solution to:

$\text{argmin}_{a,c}\sum_i \left( az_i+c - y_i \right)^2\,,$

which is just an ordinary linear regression problem.

With a little additional effort (i.e. substitution of the solution for $\hat{a}$ and $\hat{c}$ as a function of $y$, $x$ and $b$ into the original LS problem), this reduces the problem to a univariate optimization problem (in $b$), which might make life somewhat easier; it could be tackled by routine optimization, for example.

That said, I'd still probably just call a nonlinear least squares function for this problem.

(The same trick could be used on your two parameter version in the other question, but I think any gain there is even smaller and I'd be even less inclined to do it.)

• Since this is already a second question on this problem I am afraid that the "little additional effort" line could need a broader description...
– Tim
May 11, 2015 at 8:30
• @Tim yes, perhaps not immediately obvious, I added some specific information May 11, 2015 at 9:13