Class SOCPLinearMaximumLoan

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

    public class SOCPLinearMaximumLoan
    extends SOCPPortfolioConstraint
    A maximum loan constraint. \[ x_j + \max(0, w^0_j) \leq l_j, \quad l_j \leq 0 \] where \(w^0_j\) and \(x_j\) are the initial and the additional weights for asset \(i\) respectively.
    • Constructor Detail

      • SOCPLinearMaximumLoan

        public SOCPLinearMaximumLoan​(Vector w0,
                                     Vector l)
        Creates a maximum loan constraint.
        Parameters:
        w0 - the initial weight
        l - the maximum loan vector; \(l_i\) is the maximum loan for asset \(i\)
      • SOCPLinearMaximumLoan

        public SOCPLinearMaximumLoan​(Vector w0,
                                     Vector l,
                                     double epsilon)
        Creates a maximum loan constraint.
        Parameters:
        w0 - the initial weight
        l - the maximum loan vector; \(l_i\) is the maximum loan for asset \(i\)
        epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
    • Method Detail

      • 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