Skip to content
Prev 242161 / 398500 Next

Sample covariance matrix in R

Alaios <alaios <at> yahoo.com> writes:
I'm sorry, where does it say that??  The expression given
for the sample covariance is

    q_{ij}=\frac{1}{N-1}\sum_{k=1}^{N}
    \left( x_{ik}-\bar{x}_i \right) \left( x_{jk}-\bar{x}_j \right) . 

if N=1 this whole thing will go up in smoke: the denominator and
numerator will both be zero.
You need more than one sample (!); even trying to do it with
two samples would give you a mathematically well-defined but
statistically awful estimate.

  I strongly suggest that you consult a statistics book or
a local expert ...

 good luck