This is the mail archive of the gsl-discuss@sourceware.org mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: computing R-squared with gsl_multifit


On Wed, Sep 26, 2007 at 10:26:29AM -0600, Patrick Alken wrote:
> > Yes, as it relates 'explained sum of squares' to 'total sum of
> > squares', so it just uses residuals, irrespective of whether these
> > were computed with a unit vector of weights, or with actual weights.
> > 
> > Wikipedia is not a bad start:
> > http://en.wikipedia.org/wiki/R-squared
> 
> Well, that wiki page says:
> 
> "If fitting is by weighted least squares or generalized least squares,
> alternative versions of R2 can be calculated appropriate to those
> statistical frameworks,"
> 
> If you use the weights in calculating the residuals then it seems
> you'd have to use them in the total sum of squares too. In the GNU
> R source, the file src/library/stats/R/lm.R has the code which
> calculates R^2 and it definitely takes weights into account for
> both the residuals and the total sum of squares.

Aiee. Thanks for checking, and correcting my off-the-cuff hint.

Dirk

-- 
Three out of two people have difficulties with fractions.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]