Stats.CovarianceMatrix Method

Definition

Namespace: Extreme.Statistics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

CovarianceMatrix(IList<Vector<Double>>) Returns the covariance matrix for an array of numerical variables.
CovarianceMatrix<T>(Matrix<T>, MultipleMissingValueAction) Returns the covariance matrix for the columns in a matrix.

Stats.CovarianceMatrix(IList<Vector<Double>>)

Returns the covariance matrix for an array of numerical variables.
C#
public static SymmetricMatrix<double> CovarianceMatrix(
	this IList<Vector<double>> variables
)

Parameters

variables  IList<Vector<Double>>
An array of Vector<T>.

Return Value

SymmetricMatrix<Double>
A symmetric matrix containing the covariance between the elements of variables.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IList<Vector<Double>>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionvariables is null.
ArgumentException

One or more of the elements of variables is null.

-or-

Not all elements of variables have the same length.

Stats.CovarianceMatrix<T>(Matrix<T>, MultipleMissingValueAction)

Returns the covariance matrix for the columns in a matrix.
C#
public static SymmetricMatrix<T> CovarianceMatrix<T>(
	this Matrix<T> matrix,
	MultipleMissingValueAction missingValueAction = MultipleMissingValueAction.Default
)

Parameters

matrix  Matrix<T>
A matrix.
missingValueAction  MultipleMissingValueAction  (Optional)
The action to take when missing values are encountered. The default is list-wise deletion.

Type Parameters

T

Return Value

SymmetricMatrix<T>
A symmetric matrix containing the covariances between the columns of matrix.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Matrix<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentNullExceptionmatrix is null.

See Also