Class COptQuestPortfolioObjective


public class COptQuestPortfolioObjective extends COptQuestSingleObjective
The COptQuestPortfolioObjective class defines the objective of an optimization as minimizing or maximizing a statistic on a measure. The user must define COptQuestProjectVariables with observations or period observations.
  • Constructor Details

    • COptQuestPortfolioObjective

      public COptQuestPortfolioObjective()
      Default constructor
    • COptQuestPortfolioObjective

      public COptQuestPortfolioObjective(String name)
      Constructor that assigns a name to the portfolio objective.
  • Method Details

    • IsLinear

      public boolean IsLinear()
      Description copied from class: COptQuestObjective
      Returns true if the objective is a linear function. This is true if the user defined the objective as a COptQuestObjectiveFunction or if the user defined the objective as a COptQuestStringObjective and the string expression is a linear expression using decision variables and coefficients.
      Overrides:
      IsLinear in class COptQuestObjective
      Returns:
      true if the objective is a linear function of the decision variables.
    • SetPortfolioStatistic

      public void SetPortfolioStatistic(int statistic, double statisticValue) throws COptQuestException
      Defines the statistic for the portfolio objective. The statistics OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV and OCLP_PROBABILITY require the statisticValue to be set. This value is ignored for all other statistics.
      Parameters:
      statistic -
      • OCLP_MEAN = 1
      • OCLP_MEDIAN = 2
      • OCLP_PERCENTILE = 3
      • OCLP_STDDEV = 4
      • OCLP_SEMI1STDDEV = 5
      • OCLP_VARIANCE = 6
      • OCLP_SEMI1VARIANCE = 7
      • OCLP_COEFFOFVAR = 8
      • OCLP_COEFFOFSEMI1VAR = 9
      • OCLP_PROBABILITY = 10
      • OCLP_SEMI2STDDEV = 11
      • OCLP_SEMI2VARIANCE = 12
      • OCLP_COEFFOFSEMI2VAR = 13
      statisticValue - - target value for OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV and OCLP_PROBABILITY
      Throws:
      COptQuestException - if the statistic or statistic value are invalid.
    • GetPortfolioStatistic

      public int GetPortfolioStatistic()
      Returns the portfolio statistic defined by the SetPortfolioStatistic() method.
      Returns:
      statistic
      • OCLP_MEAN = 1
      • OCLP_MEDIAN = 2
      • OCLP_PERCENTILE = 3
      • OCLP_STDDEV = 4
      • OCLP_SEMI1STDDEV = 5
      • OCLP_VARIANCE = 6
      • OCLP_SEMI1VARIANCE = 7
      • OCLP_COEFFOFVAR = 8
      • OCLP_COEFFOFSEMI1VAR = 9
      • OCLP_PROBABILITY = 10
      • OCLP_SEMI2STDDEV = 11
      • OCLP_SEMI2VARIANCE = 12
      • OCLP_COEFFOFSEMI2VAR = 13
    • GetPortfolioStatisticValue

      public double GetPortfolioStatisticValue()
      Returns the statistic value defined by the SetPortfolioStatistic() method. The statistics OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV and OCLP_PROBABILITY require the statisticValue to be set.
      Returns:
      the target value for OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV and OCLP_PROBABILITY. Returns 0 for all other statistics.
    • SetPortfolioMeasure

      public void SetPortfolioMeasure(int measure) throws COptQuestException
      Defines the measure for the portfolio objective.
      Parameters:
      measure -
      • OCLP_NPV = 1
      • OCLP_IRR = 2
      • OCLP_PBP = 3
      Throws:
      COptQuestException - if the measure is invalid.
    • GetPortfolioMeasure

      public int GetPortfolioMeasure()
      Returns the portfolio measure set by the SetPortfolioMeasure() method.
      Returns:
      the integer value that identifies the portfolio measure
      • OCLP_NPV = 1
      • OCLP_IRR = 2
      • OCLP_PBP = 3