Class IndependentCoVAR
- java.lang.Object
-
- tech.nmfin.meanreversion.daspremont2008.IndependentCoVAR
-
public class IndependentCoVAR extends Object
This algorithm finds the independent variables based on the covariance matrix. First this algorithm starts with x1, and finds all the xi that are related to x1. Then add them (including x1) to group 1. Then this algorithm selects the first variable,xk, that is not in group 1, and finds all the variables related to xk. And add them to group 2. This procedure goes on until all the variables are in one of the groups.
-
-
Constructor Summary
Constructors Constructor Description IndependentCoVAR(Matrix cov, double tol)
Runs the algorithm with the given covariance matrix.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
groupCount()
Returns the total number of independent groups.List<List<Integer>>
groups()
Returns the grouped variable indices.
-
-
-
Constructor Detail
-
IndependentCoVAR
public IndependentCoVAR(Matrix cov, double tol)
Runs the algorithm with the given covariance matrix.- Parameters:
cov
- the covariance matrixtol
- the tolerance, two variables are considered as independent if their covariance is smaller than the tolerance
-
-
Method Detail
-
groups
public List<List<Integer>> groups()
Returns the grouped variable indices. The variables in one list are independent to variables in other lists.- Returns:
- the grouped variable indices
-
groupCount
public int groupCount()
Returns the total number of independent groups.- Returns:
- the total number of independent groups
-
-