[R-SIG-Finance] FW: Covariance in R - wrong?

Carlos J. Gil Bellosta cgb at datanalytics.com
Mon Jan 12 09:45:02 CET 2009


From

?cov

"The denominator n - 1 is used which gives an unbiased estimator of the
(co)variance for i.i.d. observations."

As you see, it tells you what the denominator is... and why.

best regards,

Carlos J. Gil Bellosta
http://www.datanalytics.com


On Mon, 2009-01-12 at 09:26 +0100, julien cuisinier wrote:
> 
> 
> Hi,I am bit puzzled by the cov() function in RChecking a function I write, it seems that R compute the covariance between two variable as:1/(n-1) sum[(x-mean(x))*(y-mean(y))]While Excel divide the sum by n instead of (n-1)...which is the right way to do as far as I know...Has anyone already encountered this? or is it just me getting crazy?I use R 2.8.0 on Mac OS XThanks for your feedbackBest regardsJulien
> 
> Descbrelo! Qu puedes hacer con el nuevo Windows Live?
> _________________________________________________________________
> Descubre todas las formas en que puedes estar en contacto con amigos y familiares.
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.



More information about the R-SIG-Finance mailing list