Class CorrelationMatrix

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

public class CorrelationMatrix extends DenseMatrix
The correlation matrix of n random variables X1, ..., Xn is the n × n matrix whose i,j entry is corr(Xi, Xj), the correlation between X1 and Xn.
See Also:
  • Constructor Details

    • CorrelationMatrix

      public CorrelationMatrix(Matrix cov)
      Construct a correlation matrix from a covariance matrix.
      Parameters:
      cov - a covariance matrix
  • Method Details

    • var

      public Vector var()
      Gets the variance of the elements.
      Returns:
      the variance of the elements
    • stdev

      public Vector stdev()
      Gets the standard deviations of the elements.
      Returns:
      the standard deviations of the elements
    • var

      public double var(int i)
      Gets the variance of the i-th element.
      Parameters:
      i - the index, counting from 1
      Returns:
      the variance of the i-th element
    • stdev

      public double stdev(int i)
      Gets the standard deviation of the i-th element.
      Parameters:
      i - the index, counting from 1
      Returns:
      the standard deviation of the i-th element