Uses of Class
edu.cmu.tetrad.util.Matrix
Packages that use Matrix
Package
Description
Contains classes for searching for (mostly structural) causal models given data.
Contains classes for various sorts of scores for running score-based algorithms.
Contains classes for running conditional independence tests for various sorts of data.
Contains some utility classes for search algorithms.
Contains some classes that aren't ready for prime time.
-
Uses of Matrix in edu.cmu.tetrad.algcomparison.algorithm.continuous.dag
Methods in edu.cmu.tetrad.algcomparison.algorithm.continuous.dag that return MatrixMethods in edu.cmu.tetrad.algcomparison.algorithm.continuous.dag that return types with arguments of type MatrixModifier and TypeMethodDescriptionIcaLingD.getStableBHats()
Retrieves the list of stable B matrices generated by the algorithm.IcaLingD.getUnstableBHats()
Retrieves the list of unstable B matrices generated by the algorithm. -
Uses of Matrix in edu.cmu.tetrad.cluster
Methods in edu.cmu.tetrad.cluster with parameters of type Matrix -
Uses of Matrix in edu.cmu.tetrad.data
Methods in edu.cmu.tetrad.data that return MatrixModifier and TypeMethodDescriptionstatic Matrix
DataTransforms.centerData
(Matrix data) centerData.static Matrix
DataTransforms.concatenate
(Matrix... dataSets) concatenate.static Matrix
cov.static Matrix
DataTransforms.getBootstrapSample
(Matrix data, int sampleSize) getBootstrapSample.BoxDataSet.getCorrelationMatrix()
getCorrelationMatrix.DataSet.getCorrelationMatrix()
If this is a continuous data set, returns the correlation matrix.NumberObjectDataSet.getCorrelationMatrix()
getCorrelationMatrix.BoxDataSet.getCovarianceMatrix()
getCovarianceMatrix.DataSet.getCovarianceMatrix()
If this is a continuous data set, returns the covariance matrix.NumberObjectDataSet.getCovarianceMatrix()
getCovarianceMatrix.TimeSeriesData.getData()
getData.BoxDataSet.getDoubleData()
getDoubleData.DataSet.getDoubleData()
getDoubleData.NumberObjectDataSet.getDoubleData()
getDoubleData.final Matrix
CorrelationMatrixOnTheFly.getMatrix()
getMatrix.final Matrix
CovarianceMatrix.getMatrix()
getMatrix.final Matrix
CovarianceMatrixOnTheFly.getMatrix()
Getter for the fieldmatrix
.final Matrix
CovarianceMatrixOnTheFly.getMatrix
(int[] rows) Getter for the fieldmatrix
.ICovarianceMatrix.getMatrix()
Retrieves the covariance matrix.CorrelationMatrix.getSelection
(int[] rows, int[] cols) Returns a submatrix based on the specified rows and columns.CorrelationMatrixOnTheFly.getSelection
(int[] rows, int[] cols) Returns a submatrix based on the specified rows and columns.CovarianceMatrix.getSelection
(int[] rows, int[] cols) Returns a submatrix based on the specified rows and columns.CovarianceMatrixOnTheFly.getSelection
(int[] rows, int[] cols) Returns a submatrix based on the specified rows and columns.CovarianceMatrixOnTheFly.getSelection
(int[] rows, int[] cols, int[] dataRows) getSelection.ICovarianceMatrix.getSelection
(int[] rows, int[] cols) Returns a submatrix based on the specified rows and columns.static Matrix
DataTransforms.standardizeData
(Matrix data) standardizeData.static Matrix
DataTransforms.standardizeData
(Matrix data, List<Node> variables) static Matrix
subMatrix.static Matrix
subMatrix.static Matrix
subMatrix.static Matrix
subMatrix.Methods in edu.cmu.tetrad.data with parameters of type MatrixModifier and TypeMethodDescriptionstatic Matrix
DataTransforms.centerData
(Matrix data) centerData.static Matrix
DataTransforms.concatenate
(Matrix... dataSets) concatenate.static boolean
DataUtils.containsMissingValue
(Matrix data) containsMissingValue.static Matrix
cov.static Matrix
DataTransforms.getBootstrapSample
(Matrix data, int sampleSize) getBootstrapSample.static Vector
mean.static Vector
means.void
Sets the covariance matrix.void
Sets the covariance matrix.void
Sets the covariance matrix.void
Sets the covariance matrix.void
Sets the covariance matrix.static Matrix
DataTransforms.standardizeData
(Matrix data) standardizeData.static Matrix
DataTransforms.standardizeData
(Matrix data, List<Node> variables) static Matrix
subMatrix.static Matrix
subMatrix.Constructors in edu.cmu.tetrad.data with parameters of type MatrixModifierConstructorDescriptionCorrelationMatrix
(List<Node> variables, Matrix matrix, int sampleSize) Constructs a correlation matrix data set using the given information.CovarianceMatrix
(List<Node> variables, Matrix matrix, int sampleSize) Protected constructor to construct a new covariance matrix using the supplied continuous variables and the the given symmetric, positive definite matrix and sample size.TimeSeriesData
(Matrix matrix, List<String> varNames) Constructs a new time series data contains for the given row-major data array and the given list of variables. -
Uses of Matrix in edu.cmu.tetrad.regression
Constructors in edu.cmu.tetrad.regression with parameters of type MatrixModifierConstructorDescriptionRegressionDataset
(Matrix data, List<Node> variables) Constructor for RegressionDataset. -
Uses of Matrix in edu.cmu.tetrad.search
Methods in edu.cmu.tetrad.search that return MatrixModifier and TypeMethodDescriptionstatic Matrix
Estimates the W matrix using FastICA.static Matrix
IcaLingD.estimateW
(DataSet data, int fastIcaMaxIter, double fastIcaTolerance, double fastIcaA, boolean verbose) Estimates the W matrix using FastICA.Fits an ICA-LiNGAM model to the given dataset using a default method for estimating W.IcaLingam.getAcyclicTrimmedBHat
(Matrix W) Calculates and returns the trimmed BHat matrix in an acyclic form using the given matrix W.FastIca.IcaResult.getK()
Returns the pre-whitening matrix that projects data onto the first n.comp principal components.FactorAnalysis.getResidual()
Returns the matrix of residuals.FastIca.IcaResult.getS()
Returns the estimated source matrix.static Matrix
IcaLingD.getScaledBHat
(PermutationMatrixPair pair) Returns the BHat matrix, permuted to the variable order of the original data and scaled so that the diagonal consists only of 1's.FastIca.IcaResult.getW()
Returns the estimated un-mixing matrix.FastIca.IcaResult.getX()
Returns the pre-processed data matrix.static Matrix
Scales the given matrix M by diving each entry (i, j) by M(j, j)FactorAnalysis.successiveFactorVarimax
(Matrix factorLoadingMatrix) Returns the matrix result for the varimax algorithm.FactorAnalysis.successiveResidual()
Successive method with residual matrix.static Matrix
Thresholds the given matrix, sending any small entries in absolute value to zero.Methods in edu.cmu.tetrad.search that return types with arguments of type MatrixModifier and TypeMethodDescriptionFits a LiNG-D model to the given dataset using a default method for estimating W.IcaLingD.getScaledBHats
(Matrix W) Performs the LiNG-D algorithm given a W matrix, which needs to be discovered elsewhere.Methods in edu.cmu.tetrad.search with parameters of type MatrixModifier and TypeMethodDescriptionstatic void
Centers each row of the given matrix by subtracting the mean of the row from each element.IcaLingam.getAcyclicTrimmedBHat
(Matrix W) Calculates and returns the trimmed BHat matrix in an acyclic form using the given matrix W.IcaLingD.getScaledBHats
(Matrix W) Performs the LiNG-D algorithm given a W matrix, which needs to be discovered elsewhere.boolean
Determines whether a BHat matrix parses to an acyclic graph.static boolean
Whether the BHat matrix represents a stable model.static @NotNull Graph
Returns a graph given a coefficient matrix and a list of variables.static PermutationMatrixPair
IcaLingD.maximizeDiagonal
(Matrix W) Finds a column permutation of the W matrix that maximizes the sum of 1 / |Wii| for diagonal elements Wii in W.static Matrix
Scales the given matrix M by diving each entry (i, j) by M(j, j)double
Calculates the score for a given row in a matrix using the specified parameters.void
Sets the initial un-mixing matrix of dimension (n.comp, n.comp).FactorAnalysis.successiveFactorVarimax
(Matrix factorLoadingMatrix) Returns the matrix result for the varimax algorithm.static Matrix
Thresholds the given matrix, sending any small entries in absolute value to zero.Constructors in edu.cmu.tetrad.search with parameters of type MatrixModifierConstructorDescriptionConstructs an instance of the Fast ICA algorithm, taking as arguments the two arguments that cannot be defaulted: the data matrix itself and the number of components to be extracted.Constructs an instance of the IcaResult class, taking as arguments the four matrices that are the result of the Fast ICA algorithm. -
Uses of Matrix in edu.cmu.tetrad.search.score
Methods in edu.cmu.tetrad.search.score that return MatrixModifier and TypeMethodDescriptionSemBicScore.CovAndCoefs.b()
Returns the value of theb
record component.SemBicScore.CovAndCoefs.cov()
Returns the value of thecov
record component.static Matrix
Computes the covariance matrix for the given subset of rows and columns in the provided data set.Methods in edu.cmu.tetrad.search.score with parameters of type MatrixModifier and TypeMethodDescriptionstatic Matrix
Computes the covariance matrix for the given subset of rows and columns in the provided data set.static SemBicScore.CovAndCoefs
SemBicScore.getCovAndCoefs
(int i, int[] parents, Matrix data, ICovarianceMatrix covariances, boolean calculateRowSubsets, boolean usePseudoInverse) Returns the covariance matrix of the regression of the ith variable on its parents and the regression coefficients.static @NotNull SemBicScore.CovAndCoefs
SemBicScore.getCovAndCoefs
(int i, int[] parents, Matrix data, ICovarianceMatrix covariances, boolean usePseudoInverse, List<Integer> rows) Returns the covariance matrix of the regression of the ith variable on its parents and the regressionstatic double
SemBicScore.getVarRy
(int i, int[] parents, Matrix data, ICovarianceMatrix covariances, boolean calculateRowSubsets, boolean usePseudoInverse) Returns the variance of the residual of the regression of the ith variable on its parents.Constructors in edu.cmu.tetrad.search.score with parameters of type MatrixModifierConstructorDescriptionCovAndCoefs
(Matrix cov, Matrix b) Creates an instance of aCovAndCoefs
record class. -
Uses of Matrix in edu.cmu.tetrad.search.test
Methods in edu.cmu.tetrad.search.test with parameters of type MatrixModifier and TypeMethodDescriptiondouble
IndTestHsic.empiricalHSIC
(Matrix Ky, Matrix Kx, int m) Empirical unconditional Hilbert-Schmidt Dependence Measure for X and Ydouble
IndTestHsic.empiricalHSICincompleteCholesky
(Matrix Gy, Matrix Gx, int m) Empirical unconditional Hilbert-Schmidt Dependence Measure for X and Y using incomplete Cholesky decomposition to approximate Gram matricesdouble
IndTestHsic.empiricalHSICincompleteCholesky
(Matrix Gy, Matrix Gx, Matrix Gz, int m) Empirical unconditional Hilbert-Schmidt Dependence Measure for X and Y given Z using incomplete Cholesky decomposition to approximate Gram matricesConstructors in edu.cmu.tetrad.search.test with parameters of type MatrixModifierConstructorDescriptionIndTestFisherZ
(Matrix data, List<Node> variables, double alpha) Constructs a new Fisher Z independence test with the listed arguments.IndTestHsic
(Matrix data, List<Node> variables, double alpha) Constructs a new HSIC Independence test. -
Uses of Matrix in edu.cmu.tetrad.search.utils
Methods in edu.cmu.tetrad.search.utils that return MatrixModifier and TypeMethodDescriptionstatic Matrix
Constructs the centralized Gram matrix for a given vector valued sample.static Matrix
Constructs Gram matrix for a given vector valued sample.static Matrix
KernelUtils.constructH
(int m) Constructs the projection matrix on 1/mPermutationMatrixPair.getPermutedMatrix()
Returns W, permuted rowwise by the permutation passed in through the constructor.static Matrix
KernelUtils.incompleteCholeskyGramMatrix
(List<Kernel> kernels, DataSet dataset, List<Node> nodes, double precision) Approximates Gram matrix using incomplete Cholesky factorizationMethods in edu.cmu.tetrad.search.utils with parameters of type MatrixModifier and TypeMethodDescriptionstatic boolean
TsUtils.allEigenvaluesAreSmallerThanOneInModulus
(Matrix mat) allEigenvaluesAreSmallerThanOneInModulus.Constructors in edu.cmu.tetrad.search.utils with parameters of type MatrixModifierConstructorDescriptionPartialCorrelation
(List<Node> nodes, Matrix cov, int sampleSize) Constructor.PermutationMatrixPair
(Matrix M, int[] rowPerm, int[] colPerm) Constructs with a given matrix M and a row and column permutation (which may be null). -
Uses of Matrix in edu.cmu.tetrad.search.work_in_progress
Methods in edu.cmu.tetrad.search.work_in_progress that return MatrixModifier and TypeMethodDescriptionGlasso.getSs()
Getter for the fieldss
.Matrix[]
MixtureModel.getVariances()
getVariances.Glasso.Result.getWwi()
Getter for the fieldwwi
.Constructors in edu.cmu.tetrad.search.work_in_progress with parameters of type MatrixModifierConstructorDescriptionConstructor for Glasso.IndTestFisherZRecursive
(Matrix data, List<Node> variables, double alpha) Constructs a new Fisher Z independence test with the listed arguments.MixtureModel
(DataSet data, double[][] dataArray, double[][] meansArray, double[] weightsArray, Matrix[] variancesArray, double[][] gammaArray) Constructs a mixture model from a mixed data set, a means matrix, a weights array, a variance matrix, and a gamma matrix.Constructor for Result. -
Uses of Matrix in edu.cmu.tetrad.sem
Methods in edu.cmu.tetrad.sem that return MatrixModifier and TypeMethodDescriptionSemEstimatorGibbs.getDataSet()
Getter for the fielddataSet
.DagScorer.getEdgeCoef()
Getter for the fieldedgeCoef
.Scorer.getEdgeCoef()
getEdgeCoef.SemIm.getEdgeCoef()
Getter for the fieldedgeCoef
.SemIm.getErrCovar()
Getter for the fielderrCovar
.DagScorer.getErrorCovar()
Getter for the fielderrorCovar
.Scorer.getErrorCovar()
getErrorCovar.ISemIm.getImplCovar
(boolean recalculate) getImplCovar.SemIm.getImplCovar
(boolean recalculate) getImplCovar.SemIm.getImplCovar
(List<Node> nodes) Getter for the fieldimplCovar
.StandardizedSemIm.getImplCovar()
Getter for the fieldimplCovar
.ISemIm.getImplCovarMeas()
getImplCovarMeas.SemIm.getImplCovarMeas()
getImplCovarMeas.StandardizedSemIm.getImplCovarMeas()
Getter for the fieldimplCovarMeas
.DagScorer.getSampleCovar()
Getter for the fieldsampleCovar
.Scorer.getSampleCovar()
getSampleCovar.SemIm.getSampleCovar()
getSampleCovar.Methods in edu.cmu.tetrad.sem with parameters of type MatrixModifier and TypeMethodDescriptiondouble
getStdDev.double
getStdDev.double
ISemIm.getVariance
(Node nodeA, Matrix implCovar) getVariance.double
SemIm.getVariance
(Node node, Matrix implCovar) Returns the variance for a given node.updatedIm.Constructors in edu.cmu.tetrad.sem with parameters of type Matrix -
Uses of Matrix in edu.cmu.tetrad.util
Methods in edu.cmu.tetrad.util that return MatrixModifier and TypeMethodDescriptionstatic Matrix
cholesky.static Matrix
MatrixUtils.convertCovToCorr
(Matrix m) Converts a covariance matrix to a correlation matrix in place; the same matrix is returned for convenience, but m is modified in the process.Matrix.copy()
copy.Vector.diag()
diag.Matrix.getPart
(int i, int j, int k, int l) getPart.Matrix.getSelection
(int[] rows, int[] cols) getSelection.static Matrix
Matrix.identity
(int rows) identity.static Matrix
TetradAlgebra.identity
(int rows) identity.static Matrix
MatrixUtils.impliedCovar
(Matrix edgeCoef, Matrix errCovar) Matrix.inverse()
Returns the inverse of the matrix.Matrix.like()
like.minus.static Matrix
multOuter.plus.Matrix.pseudoinverse()
Returns the Moore-Penrose pseudoinverse of the matrix.Matrix.scalarMult
(double scalar) scalarMult.static Matrix
Matrix.serializableInstance()
Generates a simple exemplar of this class to test serialization.static Matrix
solve.static Matrix
Matrix.sparseMatrix
(int m, int n) sparseMatrix.Matrix.sqrt()
sqrt.times.Matrix.transpose()
transpose.Methods in edu.cmu.tetrad.util with parameters of type MatrixModifier and TypeMethodDescriptionvoid
assign.static Matrix
cholesky.static Matrix
MatrixUtils.convertCovToCorr
(Matrix m) Converts a covariance matrix to a correlation matrix in place; the same matrix is returned for convenience, but m is modified in the process.boolean
equals.static Matrix
MatrixUtils.impliedCovar
(Matrix edgeCoef, Matrix errCovar) static boolean
MatrixUtils.isPositiveDefinite
(Matrix matrix) Return true if the given matrix is symmetric positive definite--that is, if it would make a valid covariance matrix.minus.static double
StatUtils.partialCorrelation
(Matrix submatrix) Assumes that the given covariance matrix was extracted in such a way that the order of the variables (in either direction) is X, Y, Z1, ..., Zn, where the partial correlation one wants is correlation(X, Y | Z1,...,Zn).static double
StatUtils.partialCorrelation
(Matrix covariance, int x, int y, int... z) partialCorrelation.static double
StatUtils.partialCorrelationPrecisionMatrix
(Matrix submatrix) partialCorrelationPrecisionMatrix.static double
StatUtils.partialCovarianceWhittaker
(Matrix submatrix) Assumes that the given covariance matrix was extracted in such a way that the order of the variables (in either direction) is X, Y, Z1, ..., Zn, where the partial covariance one wants is covariance(X, Y | Z1,...,Zn).static double
StatUtils.partialCovarianceWhittaker
(Matrix covariance, int x, int y, int... z) partialCovarianceWhittaker.static double
StatUtils.partialStandardDeviation
(Matrix covariance, int x, int... z) partialStandardDeviation.static double
StatUtils.partialVariance
(Matrix covariance, int x, int... z) partialVariance.plus.static Vector
product.static Matrix
solve.times.Constructors in edu.cmu.tetrad.util with parameters of type Matrix