/** Tests present value in the region where there is no extrapolation. Tests long/short parity. */ @Test public void testPresentValueNoExtra() { final YieldCurveBundle curves = TestsDataSetsSABR.createCurves1(); final SABRInterestRateParameters sabrParameter = TestsDataSetsSABR.createSABRExtrapolation1(CUT_OFF_STRIKE, MU); final SABRInterestRateDataBundle sabrBundle = new SABRInterestRateDataBundle(sabrParameter, curves); final SwaptionCashFixedIborSABRExtrapolationRightMethod method = new SwaptionCashFixedIborSABRExtrapolationRightMethod(CUT_OFF_STRIKE, MU); final double priceLongPayer = method.presentValue(SWAPTION_LONG_PAYER, sabrBundle); final double priceShortPayer = method.presentValue(SWAPTION_SHORT_PAYER, sabrBundle); final double priceLongReceiver = method.presentValue(SWAPTION_LONG_RECEIVER, sabrBundle); final double priceShortReceiver = method.presentValue(SWAPTION_SHORT_RECEIVER, sabrBundle); final double priceLongPayerNoExtra = PVC.visit(SWAPTION_LONG_PAYER, sabrBundle); final double priceShortPayerNoExtra = PVC.visit(SWAPTION_SHORT_PAYER, sabrBundle); final double priceLongReceiverNoExtra = PVC.visit(SWAPTION_LONG_RECEIVER, sabrBundle); final double priceShortReceiverNoExtra = PVC.visit(SWAPTION_SHORT_RECEIVER, sabrBundle); assertEquals( "Swaption cash SABR extrapolation: below cut-off strike", priceLongPayerNoExtra, priceLongPayer, 1E-2); assertEquals( "Swaption cash SABR extrapolation: below cut-off strike", priceShortPayerNoExtra, priceShortPayer, 1E-2); assertEquals( "Swaption cash SABR extrapolation: below cut-off strike", priceLongReceiverNoExtra, priceLongReceiver, 1E-2); assertEquals( "Swaption cash SABR extrapolation: below cut-off strike", priceShortReceiverNoExtra, priceShortReceiver, 1E-2); assertEquals( "Swaption cash SABR extrapolation: below cut-off strike long/short parity", priceLongPayer, -priceShortPayer, 1E-2); assertEquals( "Swaption cash SABR extrapolation: below cut-off strike long/short parity", priceLongReceiver, -priceShortReceiver, 1E-2); }