Package edu.cmu.tetrad.data
Class DataUtils
java.lang.Object
edu.cmu.tetrad.data.DataUtils
Some static utility methods for dealing with data sets.
- Author:
- Various folks.
-
Method Summary
Modifier and TypeMethodDescriptionstatic DataSetstatic booleancontainsMissingValue(DataSet data) static booleancontainsMissingValue(Matrix data) static MatrixcreateContinuousVariables(String[] varNames) static StringdefaultCategory(int index) 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) static booleanStates whether the given column of the given data set is binary.static Vectorstatic Vectormeans(double[][] data) Column major data.static Vectorstatic double[]ranks(double[] x) static Matrixstatic Matrixstatic Matrixstatic Matrix
-
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
- 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. -
containsMissingValue
- Returns:
- true iff the data sets contains a missing value.
-
containsMissingValue
-
createContinuousVariables
-
subMatrix
- Returns:
- the submatrix of m with variables in the order of the x variables.
-
subMatrix
- Returns:
- the submatrix of m with variables in the order of the x variables.
-
subMatrix
- Returns:
- the submatrix of m with variables in the order of the x variables.
-
subMatrix
public static Matrix subMatrix(ICovarianceMatrix m, Map<Node, Integer> indexMap, Node x, Node y, List<Node> z) - Returns:
- the submatrix of m with variables in the order of the x variables.
-
means
-
means
Column major data. -
cov
-
mean
-
choleskySimulation
- Parameters:
cov- The variables and covariance matrix over the variables.- Returns:
- The simulated data.
-
ranks
public static double[] ranks(double[] x) -
getExampleNonsingular
-
getEss
Returns the equivalent sample size, assuming all units are equally correlated and all unit variances are equal.
-