James_H has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I'm looking for a Stats module that calculates the co-var of a population _sample_ rather than population co-var.

If there was one that works with matrices even better. At the mo I use Math-MatrixReal.

Any suggestions?

Thanks, James.

Replies are listed 'Best First'.
Re: Covariance of a Sample
by BrowserUk (Patriarch) on Nov 06, 2011 at 13:53 UTC

    If you've already calculated (or have a function to calculate) the population covariance, can't you obtain the sample covariance using:

    sampleCov = popCov * n / ( n - 1)

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.