Class PortfolioRiskExactSigma
- java.lang.Object
-
- dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint
-
- dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPRiskConstraint
-
- dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.PortfolioRiskExactSigma
-
- All Implemented Interfaces:
Function<Vector,Double>
,RealScalarFunction
public class PortfolioRiskExactSigma extends SOCPRiskConstraint
Constructs the constraint coefficient arrays of the portfolio risk term in the compact form. The constraints are generated during the transformation of the objective function.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PortfolioRiskExactSigma.DefaultRoot
Computes the matrix root by Cholesky and on failure by MatrixRootByDiagonalization.static class
PortfolioRiskExactSigma.Diagonalization
Computes the matrix root by MatrixRootByDiagonalization.static interface
PortfolioRiskExactSigma.MatrixRoot
Specifies the method to compute the root of a matrix.-
Nested classes/interfaces inherited from class dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint
SOCPPortfolioConstraint.ConstraintViolationException, SOCPPortfolioConstraint.Variable
-
Nested classes/interfaces inherited from interface dev.nm.analysis.function.Function
Function.EvaluationException
-
-
Constructor Summary
Constructors Constructor Description PortfolioRiskExactSigma(Matrix Sigma)
Transforms the portfolio risk term, \(y^{\top}\Sigma\;y\leq t_1\), into the standard SOCP form when the exact covariance matrix is used.PortfolioRiskExactSigma(Matrix Sigma, Matrix sigmaRoot)
Transforms the portfolio risk term, \(y^{\top}\Sigma\;y\leq t_1\), into the standard SOCP form when the exact covariance matrix is used.PortfolioRiskExactSigma(Matrix Sigma, PortfolioRiskExactSigma.MatrixRoot root)
Transforms the portfolio risk term, \(y^{\top}\Sigma\;y\leq t_1\), into the standard SOCP form when the exact covariance matrix is used.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areAllConstraintsSatisfied(Vector y)
Checks whether all SOCP constraints represented by this portfolio constraint are satisfied.int
dimensionOfDomain()
Get the number of variables the function has.int
dimensionOfRange()
Get the dimension of the range space of the function.Double
evaluate(Vector y)
Evaluate the function f at x, where x is from the domain.Matrix
root()
Matrix
Sigma()
-
Methods inherited from class dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint
generalConstraints, getVariables, linearEqualities, linearInequalities, newSOCPGeneralConstraints, newSOCPLinearEqualities, newSOCPLinearInequalities
-
-
-
-
Constructor Detail
-
PortfolioRiskExactSigma
public PortfolioRiskExactSigma(Matrix Sigma, PortfolioRiskExactSigma.MatrixRoot root)
Transforms the portfolio risk term, \(y^{\top}\Sigma\;y\leq t_1\), into the standard SOCP form when the exact covariance matrix is used.- Parameters:
Sigma
- the covariance matrixroot
- the method to compute the root of a matrix
-
PortfolioRiskExactSigma
public PortfolioRiskExactSigma(Matrix Sigma, Matrix sigmaRoot)
Transforms the portfolio risk term, \(y^{\top}\Sigma\;y\leq t_1\), into the standard SOCP form when the exact covariance matrix is used.- Parameters:
Sigma
- the covariance matrixsigmaRoot
- the root of a matrix
-
PortfolioRiskExactSigma
public PortfolioRiskExactSigma(Matrix Sigma)
Transforms the portfolio risk term, \(y^{\top}\Sigma\;y\leq t_1\), into the standard SOCP form when the exact covariance matrix is used.- Parameters:
Sigma
- the covariance matrix
-
-
Method Detail
-
Sigma
public Matrix Sigma()
- Specified by:
Sigma
in classSOCPRiskConstraint
-
root
public Matrix root()
-
areAllConstraintsSatisfied
public boolean areAllConstraintsSatisfied(Vector y)
Checks whether all SOCP constraints represented by this portfolio constraint are satisfied. The constraint generated by objective function to find the optimal solution. It cannot be "violated".- Specified by:
areAllConstraintsSatisfied
in classSOCPPortfolioConstraint
- Parameters:
y
- a portfolio solution or allocation; the asset weights- Returns:
true
-
evaluate
public Double evaluate(Vector y)
Description copied from interface:Function
Evaluate the function f at x, where x is from the domain.- Parameters:
y
- x- Returns:
- f(x)
-
dimensionOfDomain
public int dimensionOfDomain()
Description copied from interface:Function
Get the number of variables the function has. For example, for a univariate function, the domain dimension is 1; for a bivariate function, the domain dimension is 2.- Returns:
- the number of variables
-
dimensionOfRange
public int dimensionOfRange()
Description copied from interface:Function
Get the dimension of the range space of the function. For example, for a Rn->Rm function, the dimension of the range is m.- Returns:
- the dimension of the range
-
-