Sample covariance matrix (source code)

= Sample covariance matrix
{title2=$S$}

For observations $x_1,\ldots,x_n$, the sample covariance matrix is $n^{-1}\sum_i(x_i-\bar x)(x_i-\bar x)^T$, or the same sum divided by $n-1$ under the unbiased convention.