Class SOCPZeroValue

  • All Implemented Interfaces:
    Function<Vector,​Double>, RealScalarFunction

    public class SOCPZeroValue
    extends SOCPPortfolioConstraint
    Transforms a zero value constraint into the compact SOCP form.

    The zero value constraint is: \[ \sum_{j=1}^{n}(w_{j}^{0}+x_{j})=0. \] By letting \(y=x+w^{0}\), the zero value constraint can be written as: \[ e^{\top}y=0, \] where \(e\in\mathbb{R}^{n}=(1,\cdots,1)^{\top}\). And it is equivalent to: \[ ||e^{\top}y||_{2}\leq 0. \] As a result the standard SOCP form of the zero value constraint can be written as: \[ ||e^{\top}y||_{2}\leq 0\Longleftrightarrow ||A^{\top}z+C||_{2}\leq b^{\top}z+d\\ A^{\top}=e^{\top},\; C=0,\; b=0_{n\times 1},\; d=0,\; z=y. \]
    See Also:
    "Reformulate the Portfolio Optimization Problem as a Second Order Cone Programming Problem, Version 7."
    • Constructor Detail

      • SOCPZeroValue

        public SOCPZeroValue​(Vector w_0,
                             double epsilon)
        Constructs a zero value constraint.
        Parameters:
        w_0 - the initial position
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
      • SOCPZeroValue

        public SOCPZeroValue​(Vector w_0)
        Constructs a zero value constraint.
        Parameters:
        w_0 - the initial position
    • Method Detail

      • bias

        public double bias​(Vector y)
        Computes the amount of deviation from zero value, hence bias.
        Parameters:
        y - the positions
        Returns:
        the sector bias
      • 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