Class SampleCovariance

java.lang.Object
dev.nm.algebra.linear.matrix.doubles.matrixtype.dense.DenseMatrix
dev.nm.stat.descriptive.covariance.SampleCovariance
All Implemented Interfaces:
Matrix, MatrixAccess, MatrixRing, MatrixTable, Densifiable, AbelianGroup<Matrix>, Monoid<Matrix>, Ring<Matrix>, Table, DeepCopyable

public class SampleCovariance extends DenseMatrix
This class computes the Covariance matrix of a matrix, where the (i, j) entry is the covariance of the i-th column and j-th column of the matrix.

The R equivalent function is cov.

  • Constructor Details

    • SampleCovariance

      public SampleCovariance(Matrix A)
      Construct the covariance matrix of a matrix. By default, the sample covariance matrix is unbiased.
      Parameters:
      A - a matrix
    • SampleCovariance

      public SampleCovariance(Matrix A, boolean unbiased)
      Construct the covariance matrix of a matrix.
      Parameters:
      A - a matrix
      unbiased - true if the estimate is unbiased