Creates a square, symmetric matrix containing the variances and
covariances of the columns in data.
Namespace:
CenterSpace.NMath.StatsAssembly: NMathStats (in NMathStats.dll) Version: 3.4.0.0
Syntax
| C# |
|---|
public static DoubleMatrix CovarianceMatrix( DoubleMatrix data ) |
| Visual Basic (Declaration) |
|---|
Public Shared Function CovarianceMatrix ( _ data As DoubleMatrix _ ) As DoubleMatrix |
| Visual C++ |
|---|
public: static DoubleMatrix^ CovarianceMatrix( DoubleMatrix^ data ) |
Parameters
- data
- Type: CenterSpace.NMath.Core..::.DoubleMatrix
Matrix.
Return Value
The covariance matrix.
Remarks
If C is the returned covariance matrix, then the diagonal elements
C[i,i] represent the variances for the columns of data. The
off-diagonal elements C[i,j] represent the covariances of columns
i and j.
Uses the default bias in StatsSettings.
Exceptions
| Exception | Condition |
|---|---|
| CenterSpace.NMath.Core..::.InvalidArgumentException | Thrown if data has only one row. |