Class ExtremalGeneralizedEigenvalueByGreedySearch
- java.lang.Object
-
- tech.nmfin.meanreversion.daspremont2008.ExtremalGeneralizedEigenvalueByGreedySearch
-
- All Implemented Interfaces:
ExtremalGeneralizedEigenvalueSolver
public class ExtremalGeneralizedEigenvalueByGreedySearch extends Object implements ExtremalGeneralizedEigenvalueSolver
Solves \[ \min_x \frac{x'Ax}{x'Bx} \\ \textup{s.t.,} \mathbf{Card}(x) \leqslant k, \left \| x \right \| = 1 \]
-
-
Constructor Summary
Constructors Constructor Description ExtremalGeneralizedEigenvalueByGreedySearch(Matrix A, Matrix B)
Constructs the problem described in Section 3.2, d'Aspremont (2008), changed to a minimization problem.ExtremalGeneralizedEigenvalueByGreedySearch(Matrix A, Matrix B, boolean isMinimizationProblem)
Constructs the problem described in Section 3.2, d'Aspremont (2008).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector
computeOptimalPositions(int card)
Computes the solution to the problem described in Section 3.2 in reference.Vector
getOptimalPositions(int minCard, int maxCard)
double
getOptimalValue()
-
-
-
Constructor Detail
-
ExtremalGeneralizedEigenvalueByGreedySearch
public ExtremalGeneralizedEigenvalueByGreedySearch(Matrix A, Matrix B)
Constructs the problem described in Section 3.2, d'Aspremont (2008), changed to a minimization problem.- Parameters:
A
- the matrix A in eq. 10, reference [1]B
- the matrix B in eq. 10, reference [1]
-
ExtremalGeneralizedEigenvalueByGreedySearch
public ExtremalGeneralizedEigenvalueByGreedySearch(Matrix A, Matrix B, boolean isMinimizationProblem)
Constructs the problem described in Section 3.2, d'Aspremont (2008).- Parameters:
A
- the matrix A in eq. 10, reference [1]B
- the matrix B in eq. 10, reference [1]isMinimizationProblem
- iftrue
, eq. 10 in reference [1] is changed to a minimization problem
-
-
Method Detail
-
computeOptimalPositions
public Vector computeOptimalPositions(int card)
Description copied from interface:ExtremalGeneralizedEigenvalueSolver
Computes the solution to the problem described in Section 3.2 in reference.- Specified by:
computeOptimalPositions
in interfaceExtremalGeneralizedEigenvalueSolver
- Parameters:
card
- the cardinality constraint, the number of non-zero elements in x, the solution- Returns:
- vector x in eq. 10 in reference
-
getOptimalPositions
public Vector getOptimalPositions(int minCard, int maxCard)
-
getOptimalValue
public double getOptimalValue()
-
-