Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Re: exponential regression
Replies: 0

 Bill Rowe Posts: 1,647 Registered: 3/14/08
Re: exponential regression
Posted: Feb 3, 2013 8:19 PM

On 2/3/13 at 2:45 AM, r.aufmann@gmail.com wrote:

>I entered Clear[a, b, x]; FindFit[{{1, 4.5}, {3, 14.0}, {5, 28.6},
>{7, 54.1}, {8, 78.6}}, a*b^x, {a, b}, x] as a text of exponential
>regression. The input returned {a->4.66625, b->1.42272}

>Fine. However, a student of mine entered the same data in a TI-84
>calculator and it returned 3.947506 (x^1.334589). These two
>equations are obviously not the same. Does anyone know why there is
>a discrepancy?

The TI calculator is transforming the expression to a linear
expression using logarithms then doing the fitting. Mathematica
is not doing that transform. You can have Mathematica use a
logarithmic transform and get the same result as the TI-84 as follows:

In[19]:= FindFit[{{1, 4.5}, {3, 14.0}, {5, 28.6}, {7, 54.1}, {8,
78.6}} /. {a_?NumericQ, b_} :> {a, Log[b]},
Log[a] + b Log[x], {a, b}, x]

Out[19]= {a->3.94751,b->1.33459}

>By the way, I tested a data set that is exactly
>exponential. FindFit and the TI-84 returned exactly the same
>equation.

Right. The difference is what happens to the error term. With
exact exponential data the error term is zero and the transform
has no effect on the regression coefficients. But with a
non-zero error term what you are computing is

Log[y + error]

and the fitting routine is using linear regression which means
it is assuming a model such as

y + error = a x + b

If the error term is multiplicative rather than additive, the
transformed problem would be preferred as it would be closer to
the maximum likelihood estimate. For additive errors, the
maximum likelihood estimate is given by the Mathematica result
using the original data with no transform.