SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.descriptive
Class CovarianceMatrix

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixMathImpl<T>
      extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixStorageImpl<DenseMatrix>
          extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.DenseMatrix
              extended by com.numericalmethod.suanshu.stats.descriptive.CovarianceMatrix
All Implemented Interfaces:
DeepCopyable, AbelianGroup<Matrix>, Monoid<Matrix>, Ring<Matrix>, Matrix, MatrixAccessor, MatrixRing, Densifiable, MatrixDimension

public class CovarianceMatrix
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.

The R equivalent function is cov.


Constructor Summary
CovarianceMatrix(Matrix A)
          Construct the covariance matrix for a matrix.
 
Method Summary
 ImmutableMatrix correlationMatrix()
          Get a copy of the correlation matrix.
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.dense.DenseMatrix
add, deepCopy, getColumn, getColumn, getMatrixData, getRow, getRow, getSample, minus, multiply, multiply, ONE, overwrite, scaled, t, toDense, ZERO
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixStorageImpl
equals, get, hashCode, set, setMatrixData
 
Methods inherited from class com.numericalmethod.suanshu.matrix.doubles.matrixtype.MatrixMathImpl
add, call, minus, multiply, nCols, nRows, opposite, setColumn, setColumn, setRow, setRow, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CovarianceMatrix

public CovarianceMatrix(Matrix A)
Construct the covariance matrix for a matrix.

Parameters:
A - a matrix
Method Detail

correlationMatrix

public ImmutableMatrix correlationMatrix()
Get a copy of the correlation matrix.

Returns:
the correlation matrix

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.