Class SabrExtrapolationReplicationCmsPeriodPricer
- java.lang.Object
-
- com.opengamma.strata.pricer.cms.SabrExtrapolationReplicationCmsPeriodPricer
-
public final class SabrExtrapolationReplicationCmsPeriodPricer extends Object
Computes the price of a CMS coupon/caplet/floorlet by swaption replication on a shifted SABR formula with extrapolation.The extrapolation is done on call prices above a certain strike. See
SabrExtrapolationRightFunction
for more details on the extrapolation method.The replication requires numerical integration. This is completed by
RungeKuttaIntegrator1D
.The consistency between
RatesProvider
andSabrParametersSwaptionVolatilities
is not checked in this class, but validated only once inSabrExtrapolationReplicationCmsLegPricer
.Reference: Hagan, P. S. (2003). Convexity conundrums: Pricing CMS swaps, caps, and floors. Wilmott Magazine, March, pages 38--44. OpenGamma implementation note: Replication pricing for linear and TEC format CMS, Version 1.2, March 2011. OpenGamma implementation note for the extrapolation: Smile extrapolation, version 1.2, May 2011.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
adjustedForwardRate(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the adjusted forward rate for a CMS coupon.double
adjustmentToForwardRate(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the adjustment to the forward rate for a CMS coupon.void
explainPresentValue(CmsPeriod period, RatesProvider ratesProvider, SabrSwaptionVolatilities swaptionVolatilities, ExplainMapBuilder builder)
Explains the present value of the CMS period.double
getCutOffStrike()
Returns the cut-off strike.double
getMu()
Returns the tail thickness parameter.DiscountingSwapProductPricer
getSwapPricer()
Returns the underlying swap pricer.static SabrExtrapolationReplicationCmsPeriodPricer
of(double cutOffStrike, double mu)
Obtains the pricer with default swap pricer.static SabrExtrapolationReplicationCmsPeriodPricer
of(DiscountingSwapProductPricer swapPricer, double cutOffStrike, double mu)
Obtains the pricer.CurrencyAmount
presentValue(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the present value by replication in SABR framework with extrapolation on the right.PointSensitivityBuilder
presentValueSensitivityModelParamsSabr(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the present value sensitivity to SABR parameters by replication in SABR framework with extrapolation on the right.PointSensitivityBuilder
presentValueSensitivityRates(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the present value curve sensitivity by replication in SABR framework with extrapolation on the right.double
presentValueSensitivityStrike(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the present value sensitivity to strike by replication in SABR framework with extrapolation on the right.
-
-
-
Method Detail
-
of
public static SabrExtrapolationReplicationCmsPeriodPricer of(DiscountingSwapProductPricer swapPricer, double cutOffStrike, double mu)
Obtains the pricer.- Parameters:
swapPricer
- the pricer for underlying swapcutOffStrike
- the cut-off strike valuemu
- the tail thickness- Returns:
- the pricer
-
of
public static SabrExtrapolationReplicationCmsPeriodPricer of(double cutOffStrike, double mu)
Obtains the pricer with default swap pricer.- Parameters:
cutOffStrike
- the cut-off strike valuemu
- the tail thickness- Returns:
- the pricer
-
getSwapPricer
public DiscountingSwapProductPricer getSwapPricer()
Returns the underlying swap pricer.- Returns:
- the pricer
-
getMu
public double getMu()
Returns the tail thickness parameter.- Returns:
- the parameter
-
getCutOffStrike
public double getCutOffStrike()
Returns the cut-off strike.- Returns:
- the strike
-
presentValue
public CurrencyAmount presentValue(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the present value by replication in SABR framework with extrapolation on the right.- Parameters:
cmsPeriod
- the CMSprovider
- the rates providerswaptionVolatilities
- the swaption volatilities- Returns:
- the present value
-
adjustedForwardRate
public double adjustedForwardRate(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the adjusted forward rate for a CMS coupon.The adjusted forward rate, is the number such that, multiplied by the notional, the year fraction and the payment date discount factor, it produces the present value. In other terms, it is the number which used in the same formula used for Ibor coupon pricing will provide the correct present value.
For period already fixed, this number will be equal to the swap index fixing.
For cap or floor the result is the adjusted forward rate for the coupon equivalent to the cap/floor, i.e. the coupon with the same dates and index but with no cap or floor strike.
- Parameters:
cmsPeriod
- the CMS period, which should be of the typeCmsPeriodType.COUPON
provider
- the rates providerswaptionVolatilities
- the swaption volatilities- Returns:
- the adjusted forward rate
-
adjustmentToForwardRate
public double adjustmentToForwardRate(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the adjustment to the forward rate for a CMS coupon.The adjustment to the forward rate, is the quantity that need to be added to the forward rate to obtain the adjusted forward rate. The adjusted forward rate is the number which used in the same formula used for Ibor coupon pricing (forward * notional * accrual factor * discount factor) will provide the correct present value.
For cap or floor the result is the adjustment to the forward rate for the coupon equivalent to the cap/floor, i.e. the coupon with the same dates and index but with no cap or floor strike.
- Parameters:
cmsPeriod
- the CMS period, which should be of the typeCmsPeriodType.COUPON
provider
- the rates providerswaptionVolatilities
- the swaption volatilities- Returns:
- the adjusted forward rate
-
presentValueSensitivityRates
public PointSensitivityBuilder presentValueSensitivityRates(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the present value curve sensitivity by replication in SABR framework with extrapolation on the right.- Parameters:
cmsPeriod
- the CMSprovider
- the rates providerswaptionVolatilities
- the swaption volatilities- Returns:
- the present value sensitivity
-
presentValueSensitivityModelParamsSabr
public PointSensitivityBuilder presentValueSensitivityModelParamsSabr(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the present value sensitivity to SABR parameters by replication in SABR framework with extrapolation on the right.- Parameters:
cmsPeriod
- the CMSprovider
- the rates providerswaptionVolatilities
- the swaption volatilities- Returns:
- the present value sensitivity
-
presentValueSensitivityStrike
public double presentValueSensitivityStrike(CmsPeriod cmsPeriod, RatesProvider provider, SabrSwaptionVolatilities swaptionVolatilities)
Computes the present value sensitivity to strike by replication in SABR framework with extrapolation on the right.- Parameters:
cmsPeriod
- the CMSprovider
- the rates providerswaptionVolatilities
- the swaption volatilities- Returns:
- the present value sensitivity
-
explainPresentValue
public void explainPresentValue(CmsPeriod period, RatesProvider ratesProvider, SabrSwaptionVolatilities swaptionVolatilities, ExplainMapBuilder builder)
Explains the present value of the CMS period.This returns explanatory information about the calculation.
- Parameters:
period
- the productratesProvider
- the rates providerswaptionVolatilities
- the volatilitiesbuilder
- the builder to populate
-
-