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
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.
The portfolio risk in the objective function is transformed into the following constraints: \[ (x+w^{0})^{\top}\Sigma(x+w^{0})\leq t_1. \] By letting \(y=x+w^{0}\), it can be written as: \[ y^{\top}\Sigma\;y\leq t_1 \] When the exact covariance matrix \(\Sigma\) is used, then the portfolio risk constraint is equivalent to: \[ y^{\top}\Sigma\;y\leq t_1 \Longleftrightarrow y^{\top}\Sigma\;y+(\frac{t_{1}-1}{2})^{2}\leq(\frac{t_{1}+1}{2})^{2}\Longleftrightarrow ||\left(\begin{array}{c}\Sigma^{\frac{1}{2}}y\\\frac{t_{1}-1}{2}\end{array}\right)||_{2}\leq \frac{t_{1}+1}{2}. \] And the standard SOCP form of the portfolio risk constraint in this case are: \[ ||\left(\begin{array}{c}\Sigma^{\frac{1}{2}}y\\\frac{t_{1}-1}{2}\end{array}\right)||_{2}\leq \frac{t_{1}+1}{2}\Longleftrightarrow ||A_{1}^{\top}z+C_{1}||_{2}\leq b^{\top}_{1}z+d_{1}\\ A_{1}^{\top}=\left(\begin{array}{cc}\Sigma^{\frac{1}{2}} invalid input: '&' 0_{n\times 1}\\0_{1\times n} invalid input: '&' 1/2\end{array}\right)\nonumber,\; C_{1}=\left(\begin{array}{c}0_{n\times 1}\\-1/2\end{array}\right),\; b_{1}=\left(\begin{array}{c}0_{n\times 1}\\1/2\end{array}\right)\; d_{1}=\frac{1}{2},\; z=\left(\begin{array}{c}y\\t_{1}\end{array}\right). \]
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Computes the matrix root by Cholesky and on failure by MatrixRootByDiagonalization.static class
Computes the matrix root by MatrixRootByDiagonalization.static interface
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
ConstructorsConstructorDescriptionPortfolioRiskExactSigma
(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.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
Modifier and TypeMethodDescriptionboolean
Checks whether all SOCP constraints represented by this portfolio constraint are satisfied.int
Get the number of variables the function has.int
Get the dimension of the range space of the function.Evaluate the function f at x, where x is from the domain.root()
Sigma()
Methods inherited from class dev.nm.solver.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint
generalConstraints, getVariables, linearEqualities, linearInequalities, newSOCPGeneralConstraints, newSOCPLinearEqualities, newSOCPLinearInequalities
-
Constructor Details
-
PortfolioRiskExactSigma
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
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
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 Details
-
Sigma
- Specified by:
Sigma
in classSOCPRiskConstraint
-
root
-
areAllConstraintsSatisfied
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
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
-