public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Ben Klemens <klemens@hss.caltech.edu>
To: gsl-discuss@sourceware.org
Subject: Sample skew and kurtosis
Date: Thu, 15 Mar 2007 23:40:00 -0000	[thread overview]
Message-ID: <20070315233956.GF1287@thebes.hss.caltech.edu> (raw)

And while I'm writing in, I thought I'd mention a little anomaly in the
skew and kurtosis calculations. The documentation defines the kurtosis as 
kurtosis = ((1/N) \sum ((x_i - \Hat\mu)/\Hat\sigma)^4)  - 3,
and similarly for the skew.

This is inconsistent. \Hat\sigma and \Hat\mu are based on a sample,
meaning that the unbiased estimate involves \sum(...)/(n-1), as opposed
to the population variance, which involves \sum(...)/n.

The same holds for the kurtosis and skew: if you have a sample and not a
population, then the unbiased estimate is of the form \sum(...)/(n-1). But
the above starts with 1/n, meaning we have population kurtosis normalized
by sample variance squared.

If we have to choose only one kurtosis and skew function, it should
probably be the sample and not the population version. The fix is trivial:
just return kurtosis * n/(n+1.0) at the end of kurtosis_m_sd, and
similarly for skew.

Regards,

BK

             reply	other threads:[~2007-03-15 23:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-15 23:40 Ben Klemens [this message]
2007-03-20 12:00 ` 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=20070315233956.GF1287@thebes.hss.caltech.edu \
    --to=klemens@hss.caltech.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).