kovariansmatrix
Kovariansmatrix is the covariance matrix of a random vector X = (X1, ..., Xp)^T. It encodes the variances Var(Xi) on the diagonal and the covariances Cov(Xi, Xj) in the off-diagonal entries. Formally, Cov(X) = E[(X - μ)(X - μ)^T], where μ = E[X] is the mean vector. The matrix is real, symmetric, and positive semidefinite; if Var(Xi) > 0 for all i and the components are not perfectly collinear, it is positive definite. Equivalently, Cov(X) = E[XX^T] - μ μ^T.
For a dataset with n observations x1, ..., xn in R^p, the sample kovariansmatrix S is computed as
Applications include describing dependence in multivariate data, principal component analysis, multivariate normal modelling, and portfolio risk