Package edu.cmu.tetrad.data
Class CorrelationMatrix
java.lang.Object
edu.cmu.tetrad.data.CovarianceMatrix
edu.cmu.tetrad.data.CorrelationMatrix
- All Implemented Interfaces:
DataModel
,ICovarianceMatrix
,KnowledgeTransferable
,VariableSource
,TetradSerializable
,Serializable
Stores a correlation matrix together with variable names and sample size; intended as a representation of a data
set.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCorrelationMatrix
(DataSet dataSet) Constructs a new correlation matrix from the the given DataSet.CorrelationMatrix
(ICovarianceMatrix matrix) Constructs a new correlation matrix using the covariances in the given covariance matrix.CorrelationMatrix
(List<Node> variables, Matrix matrix, int sampleSize) Constructs a correlation matrix data set using the given information. -
Method Summary
Modifier and TypeMethodDescriptiongetSelection
(int[] rows, int[] cols) getSelection.getSubCorrMatrix
(String[] submatrixVarNames) getSubCorrMatrix.static CorrelationMatrix
Generates a simple exemplar of this class to test serialization.void
setMatrix.Methods inherited from class edu.cmu.tetrad.data.CovarianceMatrix
clearSelection, copy, getDimension, getKnowledge, getMatrix, getName, getSampleSize, getSelectedVariableNames, getSize, getSubmatrix, getSubmatrix, getSubmatrix, getValue, getVariable, getVariableName, getVariableNames, getVariables, isContinuous, isDiscrete, isMixed, isSelected, isSingular, removeVariables, select, setKnowledge, setName, setSampleSize, setValue, setVariables, toString
-
Constructor Details
-
CorrelationMatrix
Constructs a new correlation matrix using the covariances in the given covariance matrix.- Parameters:
matrix
- aICovarianceMatrix
object
-
CorrelationMatrix
Constructs a new correlation matrix from the the given DataSet.- Parameters:
dataSet
- aDataSet
object
-
CorrelationMatrix
Constructs a correlation matrix data set using the given information. The matrix matrix is internally converted to a correlation matrix.
-
-
Method Details
-
serializableInstance
Generates a simple exemplar of this class to test serialization.- Returns:
- a
CorrelationMatrix
object
-
setMatrix
setMatrix.
- Specified by:
setMatrix
in interfaceICovarianceMatrix
- Overrides:
setMatrix
in classCovarianceMatrix
- Parameters:
matrix
- aMatrix
object
-
getSelection
getSelection.
- Specified by:
getSelection
in interfaceICovarianceMatrix
- Overrides:
getSelection
in classCovarianceMatrix
- Parameters:
rows
- an array ofint
objectscols
- an array ofint
objects- Returns:
- a
Matrix
object
-
getSubCorrMatrix
getSubCorrMatrix.
- Parameters:
submatrixVarNames
- an array ofString
objects- Returns:
- a submatrix, returning as a correlation matrix, with variables in the given order.
-