Seeking origin of variance equation

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?)

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

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.