Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13361

Re: exponential regression

From Bill Rowe <readnews@sbcglobal.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: exponential regression
Date 2013-02-04 01:19 +0000
Message-ID <ken2bg$7f2$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


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.

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: exponential regression Bill Rowe <readnews@sbcglobal.net> - 2013-02-04 01:19 +0000

csiph-web