Package edu.cmu.tetrad.data
Class DataUtils
java.lang.Object
edu.cmu.tetrad.data.DataUtils
Some static utility methods for dealing with data sets.
- Version:
- $Id: $Id
- Author:
- Various folks.
- 
Method SummaryModifier and TypeMethodDescriptionstatic DataSetcholeskySimulation.static booleancontainsMissingValue(DataSet data) containsMissingValue.static booleancontainsMissingValue(Matrix data) containsMissingValue.static Matrixcov.static org.ejml.simple.SimpleMatrixcov(org.ejml.simple.SimpleMatrix data) Computes the covariance matrix for the given data.createContinuousVariables(String[] varNames) createContinuousVariables.static StringdefaultCategory(int index) defaultCategory.static DataSetA discrete data set used to construct some other serializable instances.static doublegetEss(ICovarianceMatrix covariances) Returns the equivalent sample size, assuming all units are equally correlated and all unit variances are equal.getExampleNonsingular(ICovarianceMatrix covarianceMatrix, int depth) getExampleNonsingular.static booleanStates whether the given column of the given data set is binary.static Vectormean.static Vectormeans(double[][] data) Column major data.static Vectormeans.static double[]ranks(double[] x) ranks.static MatrixsubMatrix.static MatrixsubMatrix.static MatrixsubMatrix.static MatrixsubMatrix.
- 
Method Details- 
isBinaryStates whether the given column of the given data set is binary.- Parameters:
- data- Ibid.
- column- Ibid.
- Returns:
- true iff the column is binary.
 
- 
defaultCategorydefaultCategory. - Parameters:
- index- Ond plus the given index.
- Returns:
- the default category for index i. (The default category should ALWAYS be obtained by calling this method.)
 
- 
discreteSerializableInstanceA discrete data set used to construct some other serializable instances.- Returns:
- a DataSetobject
 
- 
containsMissingValuecontainsMissingValue. - Parameters:
- data- a- Matrixobject
- Returns:
- true iff the data sets contains a missing value.
 
- 
containsMissingValuecontainsMissingValue. - Parameters:
- data- a- DataSetobject
- Returns:
- a boolean
 
- 
createContinuousVariablescreateContinuousVariables. 
- 
subMatrixsubMatrix. - Parameters:
- m- a- ICovarianceMatrixobject
- x- a- Nodeobject
- y- a- Nodeobject
- z- a- Listobject
- Returns:
- the submatrix of m with variables in the order of the x variables.
 
- 
subMatrixsubMatrix. 
- 
subMatrixsubMatrix. 
- 
subMatrixpublic static Matrix subMatrix(ICovarianceMatrix m, Map<Node, Integer> indexMap, Node x, Node y, List<Node> z) subMatrix. - Parameters:
- m- a- ICovarianceMatrixobject
- indexMap- a- Mapobject
- x- a- Nodeobject
- y- a- Nodeobject
- z- a- Listobject
- Returns:
- the submatrix of m with variables in the order of the x variables.
 
- 
meansmeans. 
- 
meansColumn major data.- Parameters:
- data- an array of objects
- Returns:
- a Vectorobject
 
- 
covcov. 
- 
covpublic static org.ejml.simple.SimpleMatrix cov(org.ejml.simple.SimpleMatrix data) Computes the covariance matrix for the given data. This method centers the columns of the input matrix, calculates the covariance, and returns the covariance matrix.- Parameters:
- data- The input data matrix where rows represent observations and columns represent variables.
- Returns:
- The covariance matrix of the given data.
 
- 
meanmean. 
- 
choleskySimulationcholeskySimulation. - Parameters:
- cov- The variables and covariance matrix over the variables.
- Returns:
- The simulated data.
 
- 
rankspublic static double[] ranks(double[] x) ranks. - Parameters:
- x- an array of objects
- Returns:
- an array of objects
 
- 
getExampleNonsingulargetExampleNonsingular. - Parameters:
- covarianceMatrix- a- ICovarianceMatrixobject
- depth- a int
- Returns:
- a Listobject
 
- 
getEssReturns the equivalent sample size, assuming all units are equally correlated and all unit variances are equal.- Parameters:
- covariances- a- ICovarianceMatrixobject
- Returns:
- a double
 
 
-