Class CapVolMarketData


  • public class CapVolMarketData
    extends Object
    This class is a container for all the cap data needed to perform the caplet bootstrapping.
    Author:
    Daniel Willhalm, Christian Fries (review and fixes)
    • Constructor Detail

      • CapVolMarketData

        public CapVolMarketData​(String index,
                                String discountIndex,
                                String indexBeforeChange,
                                CapTenorStructure capTenorStructure,
                                int[] expiryVectorInMonths,
                                double[] strikeVector,
                                double[][] capVolatilities,
                                double shift,
                                int underlyingTenorInMonths,
                                int tenorChangeTimeInMonths,
                                int underlyingTenorInMonthsBeforeChange)
        The constructor of the cap volatility market data class. In case the underlying tenor changes throughout the expiry dates two indexes and tenors are submitted as parameters.
        Parameters:
        shift - The shift of the volatilities.
        underlyingTenorInMonths - The underlying tenor in months.
        underlyingTenorInMonthsBeforeChange - The underlying tenor in months before the tenor change.
        capVolatilities - The matrix with cap volatilities as entries.
        expiryVectorInMonths - The expiry dates given in months.
        strikeVector - The caplet strikes.
        index - The forward curve index.
        indexBeforeChange - The forward curve index before the tenor change.
        discountIndex - The discount curve index.
        capTenorStructure - Enum that determines the currency.
        tenorChangeTimeInMonths - The time in months after which the tenor changes.
      • CapVolMarketData

        public CapVolMarketData​(String index,
                                String discountIndex,
                                CapTenorStructure capTenorStructure,
                                int[] expiryVectorInMonths,
                                double[] strikeVector,
                                double[][] capVolatilities,
                                double shift,
                                int underlyingTenorInMonths)
        Overloaded constructor of the cap volatility market data class that assumes no tenor change.
        Parameters:
        index - The forward curve index.
        discountIndex - The discount curve index.
        capVolatilities - The matrix with cap volatilities as entries.
        expiryVectorInMonths - The expiry dates given in months.
        strikeVector - The caplet strikes.
        capTenorStructure - Enum that determines the currency.
        shift - The shift of the volatilities.
        underlyingTenorInMonths - The underlying tenor in months.
    • Method Detail

      • getCapVolData

        public double getCapVolData​(int expiry,
                                    double strike)
      • getCapVolData

        public double getCapVolData​(int i,
                                    int j)
      • getShift

        public double getShift()
      • getNumberOfStrikes

        public int getNumberOfStrikes()
      • getNumberOfExpiryDates

        public int getNumberOfExpiryDates()
      • getMaxExpiryInMonths

        public int getMaxExpiryInMonths()
      • getMaxExpiryInYears

        public double getMaxExpiryInYears()
      • getExpiryInMonths

        public int getExpiryInMonths​(int i)
      • getExpiryInYears

        public double getExpiryInYears​(int i)
      • getVolMatrix

        public double[][] getVolMatrix()
      • getStrikeVector

        public double[] getStrikeVector()
      • getExpiryVectorInMonths

        public int[] getExpiryVectorInMonths()
      • getExpiryVectorInYears

        public double[] getExpiryVectorInYears()
      • getRowIndex

        public int getRowIndex​(int expiryInMonths)
      • getStrike

        public double getStrike​(int j)
      • getColumnIndex

        public int getColumnIndex​(double strike)
      • getUnderlyingTenorInMonths

        public int getUnderlyingTenorInMonths()
      • getUnderlyingTenorInMonthsBeforeChange

        public int getUnderlyingTenorInMonthsBeforeChange()
      • getTenorChangeTimeInMonths

        public int getTenorChangeTimeInMonths()
      • getIndex

        public String getIndex()
      • getIndexBeforeChange

        public String getIndexBeforeChange()
      • getDiscountIndex

        public String getDiscountIndex()
      • setCapVolMatrixEntry

        public void setCapVolMatrixEntry​(int i,
                                         int j,
                                         double newValue)
      • getOffsetCodeFromIndex

        public static String getOffsetCodeFromIndex​(String index)