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.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
-
containsMissingValue
-
containsMissingValue
-
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
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
-
cov
-
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
-