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

Class SOCPUnity

• java.lang.Object
• com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint
• com.numericalmethod.algoquant.model.portfoliooptimization.socp.constraints.SOCPUnity
• 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 SOCPUnity
extends com.numericalmethod.suanshu.optimization.multivariate.constrained.convex.sdp.socp.problem.portfoliooptimization.SOCPPortfolioConstraint
Transforms a unity constraint into the compact SOCP form. The unity constraint is: $\sum_{j=1}^{n}(w_{j}^{0}+x_{j})=1.$ By letting $$y=x+w^{0}$$, the unity constraint can be written as: $e^{\top}y=1,$ where $$e\in\mathbb{R}^{n}=(1,\cdots,1)^{\top}$$. And it is equivalent to: $||e^{\top}y-1||_{2}\leq 0.$ As a result the standard SOCP form of a unity constraint can be written as: $||e^{\top}y-1||_{2}\leq 0\Longleftrightarrow ||A^{\top}z+C||_{2}\leq b^{\top}z+d\\ A^{\top}=e^{\top},\; C=-1,\; b=0_{n\times 1},\; d=0,\; 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
SOCPUnity(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector w_0)
Constructs a unity constraint.
SOCPUnity(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector w_0, double epsilon)
Constructs a unity constraint.
• Method Summary

All Methods
Modifier and Type Method and Description
boolean areAllConstraintsSatisfied(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector x)
double bias(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector y)
Computes the amount of deviation from unity, hence bias.
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

• SOCPUnity

public SOCPUnity(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector w_0,
double epsilon)
Constructs a unity constraint. A unity constraint is that the summation of y equals 1.
Parameters:
w_0 - the initial position
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
• SOCPUnity

public SOCPUnity(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector w_0)
Constructs a unity constraint. A unity constraint is that the summation of y equals 1.
Parameters:
w_0 - the initial position
• Method Detail

• bias

public double bias(com.numericalmethod.suanshu.algebra.linear.vector.doubles.Vector y)
Computes the amount of deviation from unity, hence bias.
Parameters:
y - the positions
Returns:
the sector bias
• 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()