Class SabrParametersSwaptionVolatilities

    • Method Detail

      • getDayCount

        public DayCount getDayCount()
        Gets the day count used to calculate the expiry year fraction.
        Returns:
        the day count
      • findData

        public <T> Optional<T> findData​(MarketDataName<T> name)
        Description copied from interface: MarketDataView
        Finds the market data with the specified name.

        This is most commonly used to find an underlying curve or surface by name. If the market data cannot be found, empty is returned.

        Specified by:
        findData in interface MarketDataView
        Type Parameters:
        T - the type of the market data value
        Parameters:
        name - the name to find
        Returns:
        the market data value, empty if not found
      • getParameterCount

        public int getParameterCount()
        Description copied from interface: ParameterizedData
        Gets the number of parameters.

        This returns the number of parameters, which can be used to create a loop to access the other methods on this interface.

        Specified by:
        getParameterCount in interface ParameterizedData
        Returns:
        the number of parameters
      • getParameter

        public double getParameter​(int parameterIndex)
        Description copied from interface: ParameterizedData
        Gets the value of the parameter at the specified index.
        Specified by:
        getParameter in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the value of the parameter
      • getParameterMetadata

        public ParameterMetadata getParameterMetadata​(int parameterIndex)
        Description copied from interface: ParameterizedData
        Gets the metadata of the parameter at the specified index.

        If there is no specific parameter metadata, an empty instance will be returned.

        Specified by:
        getParameterMetadata in interface ParameterizedData
        Parameters:
        parameterIndex - the zero-based index of the parameter to get
        Returns:
        the metadata of the parameter
      • volatilityAdjoint

        public ValueDerivatives volatilityAdjoint​(double expiry,
                                                  double tenor,
                                                  double strike,
                                                  double forward)
        Description copied from interface: SabrSwaptionVolatilities
        Calculates the volatility and associated sensitivities.

        The derivatives are stored in an array with:

        • [0] derivative with respect to the forward
        • [1] derivative with respect to the forward strike
        • [2] derivative with respect to the alpha
        • [3] derivative with respect to the beta
        • [4] derivative with respect to the rho
        • [5] derivative with respect to the nu
        Specified by:
        volatilityAdjoint in interface SabrSwaptionVolatilities
        Parameters:
        expiry - the time to expiry as a year fraction
        tenor - the tenor of the instrument as a year fraction
        strike - the strike
        forward - the forward
        Returns:
        the volatility and associated sensitivities
      • alpha

        public double alpha​(double expiry,
                            double tenor)
        Description copied from interface: SabrSwaptionVolatilities
        Calculates the alpha parameter for a pair of time to expiry and instrument tenor.
        Specified by:
        alpha in interface SabrSwaptionVolatilities
        Parameters:
        expiry - the time to expiry as a year fraction
        tenor - the tenor of the instrument as a year fraction
        Returns:
        the alpha parameter
      • beta

        public double beta​(double expiry,
                           double tenor)
        Description copied from interface: SabrSwaptionVolatilities
        Calculates the beta parameter for a pair of time to expiry and instrument tenor.
        Specified by:
        beta in interface SabrSwaptionVolatilities
        Parameters:
        expiry - the time to expiry as a year fraction
        tenor - the tenor of the instrument as a year fraction
        Returns:
        the beta parameter
      • rho

        public double rho​(double expiry,
                          double tenor)
        Description copied from interface: SabrSwaptionVolatilities
        Calculates the rho parameter for a pair of time to expiry and instrument tenor.
        Specified by:
        rho in interface SabrSwaptionVolatilities
        Parameters:
        expiry - the time to expiry as a year fraction
        tenor - the tenor of the instrument as a year fraction
        Returns:
        the rho parameter
      • nu

        public double nu​(double expiry,
                         double tenor)
        Description copied from interface: SabrSwaptionVolatilities
        Calculates the nu parameter for a pair of time to expiry and instrument tenor.
        Specified by:
        nu in interface SabrSwaptionVolatilities
        Parameters:
        expiry - the time to expiry as a year fraction
        tenor - the tenor of the instrument as a year fraction
        Returns:
        the nu parameter
      • shift

        public double shift​(double expiry,
                            double tenor)
        Description copied from interface: SabrSwaptionVolatilities
        Calculates the shift parameter for the specified time to expiry and instrument tenor.
        Specified by:
        shift in interface SabrSwaptionVolatilities
        Parameters:
        expiry - the time to expiry as a year fraction
        tenor - the tenor of the instrument as a year fraction
        Returns:
        the shift parameter
      • relativeTime

        public double relativeTime​(ZonedDateTime dateTime)
        Description copied from interface: SwaptionVolatilities
        Converts a time and date to a relative year fraction.

        When the date is after the valuation date (and potentially time), the returned number is negative.

        Specified by:
        relativeTime in interface SwaptionVolatilities
        Parameters:
        dateTime - the date-time to find the relative year fraction of
        Returns:
        the relative year fraction
      • tenor

        public double tenor​(LocalDate startDate,
                            LocalDate endDate)
        Description copied from interface: SwaptionVolatilities
        Calculates the tenor of the swap based on its start date and end date.
        Specified by:
        tenor in interface SwaptionVolatilities
        Parameters:
        startDate - the start date
        endDate - the end date
        Returns:
        the tenor
      • getValuationDateTime

        public ZonedDateTime getValuationDateTime()
        Gets the valuation date-time.

        The volatilities are calibrated for this date-time.

        Specified by:
        getValuationDateTime in interface SwaptionVolatilities
        Returns:
        the value of the property, not null
      • getParameters

        public SabrInterestRateParameters getParameters()
        Gets the SABR model parameters.

        Each model parameter of SABR model is a surface. The x-value of the surface is the expiry, as a year fraction. The y-value of the surface is the swap tenor, as a year fraction rounded to the month.

        Returns:
        the value of the property, not null
      • getDataSensitivityAlpha

        public Optional<ImmutableList<DoubleArray>> getDataSensitivityAlpha()
        Gets the sensitivity of the Alpha parameters to the raw data used for calibration.

        The order of the sensitivities have to be coherent with the surface parameter metadata.

        Returns:
        the optional value of the property, not null
      • getDataSensitivityBeta

        public Optional<ImmutableList<DoubleArray>> getDataSensitivityBeta()
        Gets the sensitivity of the Beta parameters to the raw data used for calibration.

        The order of the sensitivities have to be coherent with the surface parameter metadata.

        Returns:
        the optional value of the property, not null
      • getDataSensitivityRho

        public Optional<ImmutableList<DoubleArray>> getDataSensitivityRho()
        Gets the sensitivity of the Rho parameters to the raw data used for calibration.

        The order of the sensitivities have to be coherent with the surface parameter metadata.

        Returns:
        the optional value of the property, not null
      • getDataSensitivityNu

        public Optional<ImmutableList<DoubleArray>> getDataSensitivityNu()
        Gets the sensitivity of the Nu parameters to the raw data used for calibration.

        The order of the sensitivities have to be coherent with the surface parameter metadata.

        Returns:
        the optional value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object