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 FloatMatrix CovarianceMatrix( FloatMatrix data, bool memoized ) |
| Visual Basic (Declaration) |
|---|
Public Shared Function CovarianceMatrix ( _ data As FloatMatrix, _ memoized As Boolean _ ) As FloatMatrix |
| Visual C++ |
|---|
public: static FloatMatrix^ CovarianceMatrix( FloatMatrix^ data, bool memoized ) |
Parameters
- data
- Type: CenterSpace.NMath.Core..::.FloatMatrix
Matrix.
- memoized
- Type: System..::.Boolean
Memoize intermediate calculations. Improve performance at the cost of using more memory
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.
Exceptions
| Exception | Condition |
|---|---|
| CenterSpace.NMath.Core..::.InvalidArgumentException | Thrown if data has only one row. |