Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

R-squared value of power law curvefitting

770 views
Skip to first unread message

lim...@gmail.com

unread,
Sep 4, 2007, 5:38:13 PM9/4/07
to
Could someone advise on how to get the R-squared value of power law
curve
fitting? Thanks!

Peter Perkins

unread,
Sep 5, 2007, 9:49:02 AM9/5/07
to

Here's a simple reference on the definition of r-squared

<http://en.wikipedia.org/wiki/Coefficient_of_determination>

and given a curve fit to your data, it's easy to compute (and if you're using,
for example the Curve Fitting Toolbox, it's computed for you).

BUT: as I think people usually define the term, the power law family of curves
does not include the model y = constant as a special case (unless constant = 0),
and so interpreting r-squared for such a model fit is questionable, because
r-squared is basically a measure of how much "better" you've done by fitting
your model than you would have by just computing the mean of the y data.

Hope this helps.

- Peter Perkins
The MathWorks, Inc.

lim...@gmail.com

unread,
Sep 14, 2007, 12:17:13 PM9/14/07
to
Thank you for the helpful response.

I noticed that the lsqcurvefit function in Matlab is programmed to fit
nonlinear functions, such as as power function. However, I can see how
calculating the R-squared value from the residuals may not be
appropriate for this model. Is there an alternative parameter for the
goodness of fit?

Cheng

Peter Perkins

unread,
Sep 17, 2007, 11:47:07 AM9/17/07
to

Cheng, I may have misspoke:

Peter Perkins wrote:
>> BUT: as I think people usually define the term, the power law family of
>> curves does not include the model y = constant as a special case (unless
>> constant = 0), and so interpreting r-squared for such a model fit is
>> questionable, because r-squared is basically a measure of how much
>> "better" you've done by fitting your model than you would have by just
>> computing the mean of the y data.

If you're fitting a model like a*x^b, and estimating both a and b, then it does
include y = constant as a special case.

ben.go...@gmail.com

unread,
Sep 18, 2007, 12:38:25 AM9/18/07
to
You can always calculate an R^2 value as a measure of goodness of fit
for a given model. However it is only when one has an intercept that
you can interpret it as a measure of explained/total variance...of
course it is debatable whether that is ever a valid interpretation ;)

bg

On Sep 17, 8:47 am, Peter Perkins


<Peter.PerkinsRemoveT...@mathworks.com> wrote:
> lim...@gmail.com wrote:
> > Thank you for the helpful response.
>
> > I noticed that the lsqcurvefit function in Matlab is programmed to fit

> > nonlinear functions, such as aspowerfunction. However, I can see how
> > calculating theR-squaredvaluefrom the residuals may not be


> > appropriate for this model. Is there an alternative parameter for the
> > goodness of fit?
>
> Cheng, I may have misspoke:
>
> Peter Perkins wrote:

> >> BUT: as I think people usually define the term, thepowerlawfamily of


> >> curves does not include the model y = constant as a special case (unless

> >> constant = 0), and so interpretingr-squaredfor such a model fit is
> >> questionable, becauser-squaredis basically a measure of how much

0 new messages