Class VolatilitySwaptionPhysicalProductPricer

    • Constructor Detail

      • VolatilitySwaptionPhysicalProductPricer

        public VolatilitySwaptionPhysicalProductPricer​(DiscountingSwapProductPricer swapPricer)
        Creates an instance.
        Parameters:
        swapPricer - the pricer for Swap
    • Method Detail

      • presentValue

        public CurrencyAmount presentValue​(ResolvedSwaption swaption,
                                           RatesProvider ratesProvider,
                                           SwaptionVolatilities swaptionVolatilities)
        Calculates the present value of the swaption.

        The result is expressed using the currency of the swaption.

        Parameters:
        swaption - the swaption
        ratesProvider - the rates provider
        swaptionVolatilities - the volatilities
        Returns:
        the present value
      • currencyExposure

        public MultiCurrencyAmount currencyExposure​(ResolvedSwaption swaption,
                                                    RatesProvider ratesProvider,
                                                    SwaptionVolatilities swaptionVolatilities)
        Computes the currency exposure of the swaption.

        This is equivalent to the present value of the swaption.

        Parameters:
        swaption - the swaption
        ratesProvider - the rates provider
        swaptionVolatilities - the volatilities
        Returns:
        the currency exposure
      • impliedVolatility

        public double impliedVolatility​(ResolvedSwaption swaption,
                                        RatesProvider ratesProvider,
                                        SwaptionVolatilities swaptionVolatilities)
        Computes the implied volatility of the swaption.
        Parameters:
        swaption - the swaption
        ratesProvider - the rates provider
        swaptionVolatilities - the volatilities
        Returns:
        the implied volatility associated with the swaption
      • forwardRate

        public double forwardRate​(ResolvedSwaption swaption,
                                  RatesProvider ratesProvider)
        Provides the forward rate.

        This is the par rate for the forward starting swap that is the underlying of the swaption.

        Parameters:
        swaption - the swaption
        ratesProvider - the rates provider
        Returns:
        the forward rate
      • presentValueGamma

        public CurrencyAmount presentValueGamma​(ResolvedSwaption swaption,
                                                RatesProvider ratesProvider,
                                                SwaptionVolatilities swaptionVolatilities)
        Calculates the present value gamma of the swaption.

        The present value gamma is given by pvbp * priceGamma where priceGamma is the second derivative of the price with respect to forward.

        The result is expressed using the currency of the swaption.

        Parameters:
        swaption - the swaption
        ratesProvider - the rates provider
        swaptionVolatilities - the volatilities
        Returns:
        the present value gamma of the swaption
      • presentValueTheta

        public CurrencyAmount presentValueTheta​(ResolvedSwaption swaption,
                                                RatesProvider ratesProvider,
                                                SwaptionVolatilities swaptionVolatilities)
        Calculates the present value of the swaption.

        The present value theta is given by pvbp * priceTheta where priceTheta is the minus of the price sensitivity to timeToExpiry.

        The result is expressed using the currency of the swaption.

        Parameters:
        swaption - the swaption
        ratesProvider - the rates provider
        swaptionVolatilities - the volatilities
        Returns:
        the present value theta of the swaption
      • presentValueSensitivityRatesStickyStrike

        public PointSensitivityBuilder presentValueSensitivityRatesStickyStrike​(ResolvedSwaption swaption,
                                                                                RatesProvider ratesProvider,
                                                                                SwaptionVolatilities swaptionVolatilities)
        Calculates the present value sensitivity of the swaption to the rate curves.

        The present value sensitivity is computed in a "sticky strike" style, i.e. the sensitivity to the curve nodes with the volatility at the swaption strike unchanged. This sensitivity does not include a potential change of volatility due to the implicit change of forward rate or moneyness.

        Parameters:
        swaption - the swaption
        ratesProvider - the rates provider
        swaptionVolatilities - the volatilities
        Returns:
        the point sensitivity to the rate curves
      • presentValueSensitivityModelParamsVolatility

        public SwaptionSensitivity presentValueSensitivityModelParamsVolatility​(ResolvedSwaption swaption,
                                                                                RatesProvider ratesProvider,
                                                                                SwaptionVolatilities swaptionVolatilities)
        Calculates the present value sensitivity to the implied volatility of the swaption.

        The sensitivity to the implied volatility is also called vega.

        Parameters:
        swaption - the swaption
        ratesProvider - the rates provider
        swaptionVolatilities - the volatilities
        Returns:
        the point sensitivity to the volatility
      • fixedLeg

        protected ResolvedSwapLeg fixedLeg​(ResolvedSwap swap)
        Checks that there is exactly one fixed leg and returns it.
        Parameters:
        swap - the swap
        Returns:
        the fixed leg
      • validate

        protected void validate​(ResolvedSwaption swaption,
                                RatesProvider ratesProvider,
                                SwaptionVolatilities swaptionVolatilities)
        Validates that the rates and volatilities providers are coherent and that the swaption is single currency physical.
        Parameters:
        swaption - the swaption
        ratesProvider - the rates provider
        swaptionVolatilities - the volatilities
      • validateSwaption

        protected void validateSwaption​(ResolvedSwaption swaption)
        Validates that the swaption is single currency physical.
        Parameters:
        swaption - the swaption