You are here: Symbol Reference > Statistics Namespace > Functions > Statistics.Covariance Function
Stats Master VCL
ContentsIndex
PreviousUpNext
Statistics.Covariance Function

Calculate the covariance matrix (Result), assuming matrix X columns are variables and its rows are observations.

Pascal
procedure Covariance(const X: TMtx; const aResult: TMtx; NormN: boolean = true); overload;

By definition the covariance matrix is a matrix of covariances between elements of a vector. It is the natural generalization to higher dimensions of the concept of the variance of a scalar-valued random variable. 

If X columns represent observation samples (variables), it's rows sample(s) values (observables), muj Xj j-th column average value, then the covariance matrix is defined as: 

 

or in matrix form: 

 

where E is the expected value. The inverse of this matrix, is called the inverse covariance matrix or the precision matrix.

This version does all necessary calculations to calculate covariance matrix.

Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!