[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Covariance Question

From: Mike Miller
Subject: Re: Covariance Question
Date: Sun, 2 Mar 2003 13:49:32 -0600 (CST)

On Sun, 2 Mar 2003, Dirk Eddelbuettel wrote:

> address@hidden:~> octave2.1 -q
> octave2.1:1> x=[3;1;3;9];
> octave2.1:2> y=[4;4;8;8];
> octave2.1:3> cov(x,y)*(length(x)-1)/length(x)
> ans = 4
> The difference depends on whether you "know" that your data comes from
> a sample versus a population. See e.g.

Right.  It's the N v. N-1 effect.  Use of N produces the maximum
likelihood estimator for multivariate normal data.  It has good properties
and is, in some ways, superior to use of N-1.  That's another reason to
use N sometimes, not just because the entire population is known.  Still,
N-1 is used much more often, and Octave uses N-1.  I think it's the right
choice for the default behavior of the cov function.  It's also what
MATLAB does.


Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]