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 Summary
Modifier 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
-
isBinary
States whether the given column of the given data set is binary.- Parameters:
data- Ibid.column- Ibid.- Returns:
- true iff the column is binary.
-
defaultCategory
defaultCategory.
- 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.)
-
discreteSerializableInstance
A discrete data set used to construct some other serializable instances.- Returns:
- a
DataSetobject
-
containsMissingValue
containsMissingValue.
- Parameters:
data- aMatrixobject- Returns:
- true iff the data sets contains a missing value.
-
containsMissingValue
containsMissingValue.
- Parameters:
data- aDataSetobject- Returns:
- a boolean
-
createContinuousVariables
createContinuousVariables.
-
subMatrix
subMatrix.
- Parameters:
m- aICovarianceMatrixobjectx- aNodeobjecty- aNodeobjectz- aListobject- Returns:
- the submatrix of m with variables in the order of the x variables.
-
subMatrix
subMatrix.
-
subMatrix
subMatrix.
-
subMatrix
public static Matrix subMatrix(ICovarianceMatrix m, Map<Node, Integer> indexMap, Node x, Node y, List<Node> z) subMatrix.
- Parameters:
m- aICovarianceMatrixobjectindexMap- aMapobjectx- aNodeobjecty- aNodeobjectz- aListobject- Returns:
- the submatrix of m with variables in the order of the x variables.
-
means
means.
-
means
Column major data.- Parameters:
data- an array of objects- Returns:
- a
Vectorobject
-
cov
cov.
-
cov
public 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.
-
mean
mean.
-
choleskySimulation
choleskySimulation.
- Parameters:
cov- The variables and covariance matrix over the variables.- Returns:
- The simulated data.
-
ranks
public static double[] ranks(double[] x) ranks.
- Parameters:
x- an array of objects- Returns:
- an array of objects
-
getExampleNonsingular
getExampleNonsingular.
- Parameters:
covarianceMatrix- aICovarianceMatrixobjectdepth- a int- Returns:
- a
Listobject
-
getEss
Returns the equivalent sample size, assuming all units are equally correlated and all unit variances are equal.- Parameters:
covariances- aICovarianceMatrixobject- Returns:
- a double
-