public class SOCPSectorNeutrality extends SOCPPortfolioConstraint
The sector neutral constraint is: \[ \sum_{j\in S_i}(w_j^0+x_j)=0,\quad i=1,\ldots,k, \] where \(S_i\) is the \(i\)th section indicator. By letting \(y=x+w^{0}\), the sector neutral constraint can be written as: \[ \sum_{j\in S_i}y_{j}=0, i=1,\cdots,k. \] And it is equivalent to: \[ ||(\sum_{j\in S_{i}}e_{j})^{\top}y||_{2}\leq 0. \] As a result the standard SOCP form of the sector neutral constraint can be written as: \[ ||(\sum_{j\in S_{i}}e_{j})^{\top}y||_{2}\leq 0\Longleftrightarrow ||A_{i}^{\top}z+C_{i}||_{2}\leq b^{\top}_{i}z+d_{i},\quad i=1,\cdots,k\\ A_{i}^{\top}=\sum_{j\in S_{i}}e^{\top}_{j},\; C_{i}=0,\; b_{i}=0_{n\times 1},\; d_{i}=0,\; z=y. \]
SOCPPortfolioConstraint.ConstraintViolationException, SOCPPortfolioConstraint.Variable
Function.EvaluationException
Constructor and Description |
---|
SOCPSectorNeutrality(Vector w_0,
Vector[] S)
Constructs a sector neutral constraint.
|
SOCPSectorNeutrality(Vector w_0,
Vector[] S,
double epsilon)
Constructs a sector neutral constraint.
|
Modifier and Type | Method and Description |
---|---|
boolean |
areAllConstraintsSatisfied(Vector y)
Checks whether all SOCP constraints represented by this portfolio
constraint are satisfied.
|
double |
bias(Vector y)
Computes the amount of deviation from neutrality, hence bias.
|
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.
|
getVariables, iterator, newSOCPGeneralConstraints
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public SOCPSectorNeutrality(Vector w_0, Vector[] S, double epsilon)
w_0
- the initial positionS
- the sector indicatorsepsilon
- a precision parameter: when a number |x| ≤ ε,
it is considered 0public double bias(Vector y)
y
- the positionspublic boolean areAllConstraintsSatisfied(Vector y) throws SOCPPortfolioConstraint.ConstraintViolationException
SOCPPortfolioConstraint
areAllConstraintsSatisfied
in class SOCPPortfolioConstraint
y
- a portfolio solution or allocation; the asset weightstrue
if and only if all SOCP constraints are satisfiedSOCPPortfolioConstraint.ConstraintViolationException
public Double evaluate(Vector y)
Function
y
- xpublic int dimensionOfDomain()
Function
public int dimensionOfRange()
Function
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.