Class EmbeddedOptionSchedule

java.lang.Object
org.drip.product.params.EmbeddedOptionSchedule

public class EmbeddedOptionSchedule
extends java.lang.Object
EmbeddedOptionSchedule is a place holder for the embedded option schedule for the component. It contains the schedule of exercise dates and factors, the exercise notice period, and the option is to call or put. Further, if the option is of the type fix-to-float on exercise, contains the post-exercise floater index and floating spread. If the exercise is not discrete (American option), the exercise dates/factors are discretized according to a pre-specified discretization grid. It exports serialization into and de- serialization out of byte arrays.



Author:
Lakshmi Krishnamurthy
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int CALL_NOTICE_PERIOD_DEFAULT
    Default Call Notice Period
  • Constructor Summary

    Constructors
    Constructor Description
    EmbeddedOptionSchedule​(int[] aiDate, double[] adblFactor, boolean bIsPut, int iNoticePeriod, boolean bFixToFloatOnExercise, double dblFixToFloatExerciseDate, java.lang.String strFloatIndex, double dblFixToFloatSpread)
    Construct the EOS from the array of dates and factors
    EmbeddedOptionSchedule​(EmbeddedOptionSchedule eosOther)
    Construct a Deep Copy EOS from another EOS
  • Method Summary

    Modifier and Type Method Description
    static EmbeddedOptionSchedule CreateFromDateFactorSet​(java.lang.String strDates, java.lang.String strFactors, int iNoticePeriod, boolean bIsPut, boolean bIsDiscrete, int iScheduleStart, boolean bFixToFloatOnExercise, double dblFixToFloatExerciseDate, java.lang.String strFloatIndex, double dblFixToFloatSpread)
    Create the EOS from the dates/factors string arrays
    int[] dates()
    Get the array of dates
    int[] exerciseDates​(int iSpotDate)
    Generate the Possible Exercise Dates from the Spot Date and the Notice Period
    double[] exerciseFactors​(int iSpotDate)
    Generate the Possible Exercise Factors from the Spot Date and the Notice Period
    int exerciseNoticePeriod()
    Retrieve the exercise notice period
    double factor​(int iIndex)
    Get the specific indexed factor
    double[] factors()
    Get the array of factors
    static EmbeddedOptionSchedule FromAmerican​(int iValDate, int[] aiDate, double[] adblFactor, boolean bIsPut, int iNoticePeriod, boolean bFixToFloatOnExercise, double dblFixToFloatExerciseDate, java.lang.String strFloatIndex, double dblFixToFloatSpread)
    Create the discretized American EOS schedule from the array of dates and factors
    static EmbeddedOptionSchedule FromAmerican​(int iValDate, int[] aiDate, double[] adblFactor, boolean bIsPut, int iNoticePeriod, int iCallDiscretization, boolean bFixToFloatOnExercise, double dblFixToFloatExerciseDate, java.lang.String strFloatIndex, double dblFixToFloatSpread)
    Create the discretized American EOS schedule from the array of dates and factors
    boolean isFixToFloatOnExercise()
    Return whether the component is fix to float on exercise
    boolean isPut()
    Whether the component is putable or callable
    int nextDate​(int iSpotDate)
    Retrieve the Next Exercise Date, starting from the Spot
    double nextFactor​(int iSpotDate)
    Retrieve the Exercise Factor corresponding to the Next Exercise Date, starting from the Spot

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CALL_NOTICE_PERIOD_DEFAULT

      public static final int CALL_NOTICE_PERIOD_DEFAULT
      Default Call Notice Period
      See Also:
      Constant Field Values
  • Constructor Details

    • EmbeddedOptionSchedule

      public EmbeddedOptionSchedule​(int[] aiDate, double[] adblFactor, boolean bIsPut, int iNoticePeriod, boolean bFixToFloatOnExercise, double dblFixToFloatExerciseDate, java.lang.String strFloatIndex, double dblFixToFloatSpread) throws java.lang.Exception
      Construct the EOS from the array of dates and factors
      Parameters:
      aiDate - Array of dates
      adblFactor - Matched Array of Factors
      bIsPut - True (Put), False (Call)
      iNoticePeriod - Exercise Notice Period
      bFixToFloatOnExercise - True - component becomes a floater on call
      dblFixToFloatExerciseDate - Date at which the fix to float conversion happens
      strFloatIndex - Floater Rate Index
      dblFixToFloatSpread - Floater Spread
      Throws:
      java.lang.Exception - Thrown if inputs are invalid
    • EmbeddedOptionSchedule

      public EmbeddedOptionSchedule​(EmbeddedOptionSchedule eosOther)
      Construct a Deep Copy EOS from another EOS
      Parameters:
      eosOther - The Other EOS
  • Method Details

    • CreateFromDateFactorSet

      public static final EmbeddedOptionSchedule CreateFromDateFactorSet​(java.lang.String strDates, java.lang.String strFactors, int iNoticePeriod, boolean bIsPut, boolean bIsDiscrete, int iScheduleStart, boolean bFixToFloatOnExercise, double dblFixToFloatExerciseDate, java.lang.String strFloatIndex, double dblFixToFloatSpread)
      Create the EOS from the dates/factors string arrays
      Parameters:
      strDates - String representing the date array
      strFactors - String representing the factor array
      iNoticePeriod - Exercise Notice Period
      bIsPut - True (Put), False (Call)
      bIsDiscrete - True (Discrete), False (Continuous)
      iScheduleStart - Schedule start Date
      bFixToFloatOnExercise - True - component becomes a floater on call
      dblFixToFloatExerciseDate - Date at which the fix to float conversion happens
      strFloatIndex - Floater Rate Index
      dblFixToFloatSpread - Floater Spread
      Returns:
      EOS object
    • FromAmerican

      public static final EmbeddedOptionSchedule FromAmerican​(int iValDate, int[] aiDate, double[] adblFactor, boolean bIsPut, int iNoticePeriod, boolean bFixToFloatOnExercise, double dblFixToFloatExerciseDate, java.lang.String strFloatIndex, double dblFixToFloatSpread)
      Create the discretized American EOS schedule from the array of dates and factors
      Parameters:
      iValDate - Valuation Date - date to which the component is assumed to not have been exercised
      aiDate - Array of dates
      adblFactor - Matched Array of Factors
      bIsPut - True (Put), False (Call)
      iNoticePeriod - Exercise Notice Period
      bFixToFloatOnExercise - True - component becomes a floater on call
      dblFixToFloatExerciseDate - Date at which the fix to float conversion happens
      strFloatIndex - Floater Rate Index
      dblFixToFloatSpread - Floater Spread
      Returns:
      Discretized EOS
    • FromAmerican

      public static final EmbeddedOptionSchedule FromAmerican​(int iValDate, int[] aiDate, double[] adblFactor, boolean bIsPut, int iNoticePeriod, int iCallDiscretization, boolean bFixToFloatOnExercise, double dblFixToFloatExerciseDate, java.lang.String strFloatIndex, double dblFixToFloatSpread)
      Create the discretized American EOS schedule from the array of dates and factors
      Parameters:
      iValDate - Valuation Date - date to which the component is assumed to not have been exercised
      aiDate - Array of dates
      adblFactor - Matched Array of Factors
      bIsPut - True (Put), False (Call)
      iNoticePeriod - Exercise Notice Period
      iCallDiscretization - Call Discretization Period Unit
      bFixToFloatOnExercise - True - component becomes a floater on call
      dblFixToFloatExerciseDate - Date at which the fix to float conversion happens
      strFloatIndex - Floater Rate Index
      dblFixToFloatSpread - Floater Spread
      Returns:
      Discretized EOS
    • isPut

      public boolean isPut()
      Whether the component is putable or callable
      Returns:
      True (Put), False (Call)
    • dates

      public int[] dates()
      Get the array of dates
      Returns:
      The array of dates
    • factors

      public double[] factors()
      Get the array of factors
      Returns:
      The array of factors
    • factor

      public double factor​(int iIndex)
      Get the specific indexed factor
      Parameters:
      iIndex - Factor index
      Returns:
      Factor corresponding to the index
    • exerciseNoticePeriod

      public int exerciseNoticePeriod()
      Retrieve the exercise notice period
      Returns:
      Minimum Exercise Notice Period in Days
    • isFixToFloatOnExercise

      public boolean isFixToFloatOnExercise()
      Return whether the component is fix to float on exercise
      Returns:
      True (component becomes a floater on call), False (component does not change)
    • exerciseDates

      public int[] exerciseDates​(int iSpotDate)
      Generate the Possible Exercise Dates from the Spot Date and the Notice Period
      Parameters:
      iSpotDate - The Spot Date
      Returns:
      Array of Possible Exercise Dates from the Spot Date and the Notice Period
    • exerciseFactors

      public double[] exerciseFactors​(int iSpotDate)
      Generate the Possible Exercise Factors from the Spot Date and the Notice Period
      Parameters:
      iSpotDate - The Spot Date
      Returns:
      Array of Possible Exercise Factors from the Spot Date and the Notice Period
    • nextDate

      public int nextDate​(int iSpotDate) throws java.lang.Exception
      Retrieve the Next Exercise Date, starting from the Spot
      Parameters:
      iSpotDate - The Spot Date
      Returns:
      Next Exercise Date
      Throws:
      java.lang.Exception - Thrown if the Inputs are Invalid
    • nextFactor

      public double nextFactor​(int iSpotDate) throws java.lang.Exception
      Retrieve the Exercise Factor corresponding to the Next Exercise Date, starting from the Spot
      Parameters:
      iSpotDate - The Spot Date
      Returns:
      Next Exercise Factor
      Throws:
      java.lang.Exception - Thrown if the Inputs are Invalid