The sample covariance matrix is $S = \frac{1}{n} \sum_{i=1}^{n} (X^{(i)}-\bar{X}) (X^{(i)}-\bar{X})^T$. Note that for normally distributed random variables, $S$ is the maximum likelihood estimator (MLE) for the covariance matrix. This is different from the unbiased estimator, which uses a denominator of $n-1$ instead of $n$.
Sample data is input as a matrix or a list. The rows of the matrix or the elements of the list are observation vectors.
|
|
|
|
The object sampleCovarianceMatrix is a method function.