Class CovarianceMatrix

java.lang.Object
edu.cmu.tetrad.data.CovarianceMatrix
All Implemented Interfaces:
DataModel, ICovarianceMatrix, KnowledgeTransferable, VariableSource, TetradSerializable, Serializable
Direct Known Subclasses:
CorrelationMatrix

public class CovarianceMatrix extends Object implements ICovarianceMatrix
Stores a covariance matrix together with variable names and sample size, intended as a representation of a data set. When constructed from a continuous data set, the matrix is not checked for positive definiteness; however, when a covariance matrix is supplied, its positive definiteness is always checked. If the sample size is less than the number of variables, the positive definiteness is "spot-checked"--that is, checked for various submatrices.
Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Details

    • CovarianceMatrix

      public CovarianceMatrix(DataSet dataSet)
      Constructs a new covariance matrix from the given data set.
      Parameters:
      dataSet - a DataSet object
      Throws:
      IllegalArgumentException - if this is not a continuous data set.
    • CovarianceMatrix

      public CovarianceMatrix(DataSet dataSet, boolean biasCorrected)

      Constructor for CovarianceMatrix.

      Parameters:
      dataSet - a DataSet object
      biasCorrected - a boolean
    • CovarianceMatrix

      public CovarianceMatrix(List<Node> variables, Matrix matrix, int sampleSize)
      Protected constructor to construct a new covariance matrix using the supplied continuous variables and the the given symmetric, positive definite matrix and sample size. The number of variables must equal the dimension of the array.
      Parameters:
      variables - the list of variables (in order) for the covariance matrix.
      matrix - an square array of containing covariances.
      sampleSize - the sample size of the data for these covariances.
      Throws:
      IllegalArgumentException - if the given matrix is not symmetric (to a tolerance of 1.e-5) and positive definite, if the number of variables does not equal the dimension of m, or if the sample size is not positive.
    • CovarianceMatrix

      public CovarianceMatrix(List<Node> variables, double[][] matrix, int sampleSize)

      Constructor for CovarianceMatrix.

      Parameters:
      variables - a List object
      matrix - an array of double objects
      sampleSize - a int
    • CovarianceMatrix

      public CovarianceMatrix(CovarianceMatrix covMatrix)
      Copy constructor.
      Parameters:
      covMatrix - a CovarianceMatrix object
    • CovarianceMatrix

      public CovarianceMatrix(ICovarianceMatrix covMatrix)

      Constructor for CovarianceMatrix.

      Parameters:
      covMatrix - a ICovarianceMatrix object
  • Method Details