Class COptQuestDiscountRateVariable


public class COptQuestDiscountRateVariable extends COptQuestProjectVariable
The COptQuestDiscountRateVariable class defines a discount rate for portfolio optimizations. Only one COptQuestDiscountRateVariable can be defined per optimization.

The discount rate is used to calculate the Net Present Value (NPV) or Payback Period(PBP) from the cash flow per period observations. The discount rate can be set as a constant discount rate for all periods/observations or it can be set per period/observation. Setting the discount rate per period/observation allows the user to use simulation to simulate the discount rate when it is unknown. If the discount rate does not change per observation, but does change per period, set all of the observations for that period to the same discount rate.

The SetCurrentValue() method is used to define the fixed rate discount rate.

If you are using observations you must call the SetNumberOfPeriods() method to set the number of periods in the portfolio and then call the SetPeriodObservations() method is used to set the observations by period.
  • Constructor Details

    • COptQuestDiscountRateVariable

      public COptQuestDiscountRateVariable(String name)
      Constructor that assigns a name to the discount rate variable.
      Parameters:
      name - alphanumeric name. Note: the name can contain blanks or special characters. If the variable name is used in a COptQuestStringConstraint equation, the name should be enclosed in square brackets [] in the COptQuestStringConstraint string equation.
    • COptQuestDiscountRateVariable

      public COptQuestDiscountRateVariable()
      Default constructor
  • Method Details

    • SetCurrentValue

      public void SetCurrentValue(double discount)
      Sets discount rate.
      Parameters:
      discount - discount rate
    • GetCurrentValue

      public double GetCurrentValue()
      Get discount rate
      Returns:
      discount rate
    • SetLowerBound

      public void SetLowerBound(double val) throws COptQuestException
      Lower bound cannot be set for discount variables
      Overrides:
      SetLowerBound in class COptQuestVariable
      Parameters:
      val - a value between -pow(2,31) and +pow(2,31)-1
      Throws:
      COptQuestException - Invalid method for COptQuestDiscountRateVariable
    • SetUpperBound

      public void SetUpperBound(double val) throws COptQuestException
      Upper bound cannot be set for discount variables
      Overrides:
      SetUpperBound in class COptQuestVariable
      Parameters:
      val - a value between -pow(2,31) and +pow(2,31)-1
      Throws:
      COptQuestException - Invalid method for COptQuestDiscountRateVariable
    • SetExclusiveRange

      public void SetExclusiveRange(double low, double high) throws COptQuestException
      Exclusive range cannot be set for discount variables
      Overrides:
      SetExclusiveRange in class COptQuestVariable
      Parameters:
      low - - any value > low will be excluded
      high - - any value < high will be excluded
      Throws:
      COptQuestException - Invalid method for COptQuestDiscountRateVariable