public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Patrick Alken <patrick.alken@colorado.edu>
To: gsl-discuss@sourceware.org
Subject: Re: computing R-squared with gsl_multifit
Date: Wed, 26 Sep 2007 16:26:00 -0000	[thread overview]
Message-ID: <20070926162628.GB27449@hippogriff.physics.drexel.edu> (raw)
In-Reply-To: <20070926161818.GA6539@eddelbuettel.com>

> 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.

  reply	other threads:[~2007-09-26 16:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-25 19:46 Patrick Alken
2007-09-26 15:52 ` Brian Gough
2007-09-26 16:18   ` Dirk Eddelbuettel
2007-09-26 16:26     ` Patrick Alken [this message]
2007-09-26 16:43       ` Dirk Eddelbuettel
2007-09-26 16:20   ` Patrick Alken
2007-10-02  8:35     ` Brian Gough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070926162628.GB27449@hippogriff.physics.drexel.edu \
    --to=patrick.alken@colorado.edu \
    --cc=gsl-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).