AlgoQuant, an integrated trading strategy research and backtesting system
com.numericalmethod.algoquant.model.portfoliooptimization.socp.constraints

## Class SOCPUpperLimit

• java.lang.Object
• com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint
• com.numericalmethod.algoquant.model.portfoliooptimization.socp.constraints.SOCPUpperLimit
• All Implemented Interfaces:
com.numericalmethod.suanshu.analysis.function.Function<com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector,Double>, com.numericalmethod.suanshu.analysis.function.rn2r1.RealScalarFunction, Iterable<com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.SOCPGeneralConstraints>

public class SOCPUpperLimit
extends com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint
Transforms an upper position limit constraint into the compact SOCP form.

The upper position limit constraint is: $(w_j^0+x_j)\leq P_{u,j},\quad j=1,\ldots,n.$ That is, $y_j\leq P_{u,j},\quad j=1,\cdots,n.$ They are equivalent to $||0||_{2}\leq -y_{j}+P_{u,j}, j=1,\cdots,n.$ As a result the standard SOCP form of the position limit constraints can be written as: $||0||_{2}\leq -\bar{y}_{j}+P_{u,j}\Longleftrightarrow ||A_{j}^{\top}z+C_{j}||_{2}\leq b^{\top}_{j}z+d_{j},\quad j=1,\cdots,n\\ A_{j}^{\top}=0_{1\times n},\; C_{j}=0,\; b_{j}=-e_{j},\; d_{j}=P_{u,j},\; z=y.$
"Reformulate the Portfolio Optimization Problem as a Second Order Cone Programming Problem, Version 7."

• ### Nested classes/interfaces inherited from class com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint

com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint.ConstraintViolationException, com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint.Variable
• ### Nested classes/interfaces inherited from interface com.numericalmethod.suanshu.analysis.function.Function

com.numericalmethod.suanshu.analysis.function.Function.EvaluationException
• ### Constructor Summary

Constructors
Constructor and Description
SOCPUpperLimit(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector w_0, com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector P_u)
Constructs an upper position limit constraint.
SOCPUpperLimit(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector w_0, com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector P_u, double epsilon)
Constructs an upper position limit constraint.
• ### Method Summary

All Methods
Modifier and Type Method and Description
boolean areAllConstraintsSatisfied(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector x)
int dimensionOfDomain()
int dimensionOfRange()
Double evaluate(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector y)
• ### Methods inherited from class com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint

getVariables, iterator, newSOCPGeneralConstraints
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Methods inherited from interface java.lang.Iterable

forEach, spliterator
• ### Constructor Detail

• #### SOCPUpperLimit

public SOCPUpperLimit(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector w_0,
com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector P_u,
double epsilon)
Constructs an upper position limit constraint.
Parameters:
w_0 - the initial position
P_u - the upper position limit
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
• #### SOCPUpperLimit

public SOCPUpperLimit(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector w_0,
com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector P_u)
Constructs an upper position limit constraint.
Parameters:
w_0 - the initial position
P_u - the upper position limit
• ### Method Detail

• #### areAllConstraintsSatisfied

public boolean areAllConstraintsSatisfied(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector x)
throws com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint.ConstraintViolationException
Specified by:
areAllConstraintsSatisfied in class com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint
Throws:
com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint.ConstraintViolationException
• #### evaluate

public Double evaluate(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector y)
• #### dimensionOfDomain

public int dimensionOfDomain()
• #### dimensionOfRange

public int dimensionOfRange()