In my data science textbook, it says that the variance of a variable $Y$ can be written as:

$v_y = \frac{1}{n-1} \sum_{k=1}^{n} y_k^{T} y_k$,

I have never seen variance defined like this before. Could someone provide some insights into this definition (i.e., why it is valid to define variance like this?)

  • $\begingroup$ it's the same as the usual formula but it assumes that the mean of $y_{k} = 0$. $\endgroup$ – mlofton Dec 29 '18 at 4:31
  • 3
    $\begingroup$ This is the formula for sample covariance $\endgroup$ – Francis Dec 29 '18 at 8:57

I think, a couple of things should be noted here:

1) This equation resembles $E[X^2]$, and it resembles the variance only if $E[X]$ is zero, since $var(X)=E[X^2]-E[X]^2$.

2) It assumes that the $y_k$'s are row vectors. So, $y_k^Ty_k$ will a matrix of $d\times d$, where $d$ is the dimension of each sample. So, we're averaging $d \times d $ matrices here, as in @Francis's sample covariance link (which assumes $y_k$'s as column vectors).

3) What you get out of this equation is a covariance matrix estimate, with entries $C_{rm}=cov(y^{r}, y^{m})$, where $y^{i}$ represents the $i$-th element of a random vector $y$.

4) $\frac{1}{n-1}$, instead of $\frac{1}{n}$ comes from unbiased estimation of sample covariance.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.