Package edu.cmu.tetrad.data
Interface Covariances
public interface Covariances
Some comemon methods for the various covariance implementations.
- Version:
- $Id: $Id
- Author:
- Joseph D. Ramsey
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longConstantserialVersionUID=23L -
Method Summary
Modifier and TypeMethodDescriptiondoublecovariance(int i, int j) Returns the covariance at (i, j).double[][]Returns the underlying covariance matrix.double[][]getSubMatrix(int[] rows, int[] cols) Returns a submatrix of the covariance matrix for the given rows and columns.voidsetCovariance(int i, int j, double v) Sets the covariance at (i, j) to a particular value.intsize()Returns the dimensiom of the matrix.
-
Field Details
-
serialVersionUID
static final long serialVersionUIDConstantserialVersionUID=23L- See Also:
-
-
Method Details
-
covariance
double covariance(int i, int j) Returns the covariance at (i, j).- Parameters:
i- a intj- a int- Returns:
- a double
-
size
int size()Returns the dimensiom of the matrix.- Returns:
- a int
-
setCovariance
void setCovariance(int i, int j, double v) Sets the covariance at (i, j) to a particular value. Not effective for implemetations that calculate covariances from data on the fly.- Parameters:
i- a intj- a intv- a double
-
getMatrix
double[][] getMatrix()Returns the underlying covariance matrix.- Returns:
- an array of objects
-
getSubMatrix
double[][] getSubMatrix(int[] rows, int[] cols) Returns a submatrix of the covariance matrix for the given rows and columns.- Parameters:
rows- an array of objectscols- an array of objects- Returns:
- an array of objects
-