InterestRateFutureOptionMarginTransactionSABRMethod extends InterestRateFutureOptionMarginTransactionGenericMethod<SABRSTIRFuturesProviderInterface> { public PresentValueSABRSensitivityDataBundle presentValueSABRSensitivity(final InterestRateFutureOptionMarginTransaction transaction, final SABRSTIRFuturesProviderInterface sabrData) { PresentValueSABRSensitivityDataBundle securitySensitivity = getSecurityMethod().priceSABRSensitivity(transaction.getUnderlyingSecurity(), sabrData); securitySensitivity = securitySensitivity.multiplyBy(transaction.getQuantity() * transaction.getUnderlyingSecurity().getUnderlyingFuture().getNotional() * transaction.getUnderlyingSecurity().getUnderlyingFuture().getPaymentAccrualFactor()); return securitySensitivity; } private  InterestRateFutureOptionMarginTransactionSABRMethod(); static InterestRateFutureOptionMarginTransactionSABRMethod getInstance(); @Override InterestRateFutureOptionMarginSecuritySABRMethod getSecurityMethod(); MultipleCurrencyAmount presentValueFromFuturePrice(final InterestRateFutureOptionMarginTransaction transaction, final SABRSTIRFuturesProviderInterface sabrData, final double priceFuture); PresentValueSABRSensitivityDataBundle presentValueSABRSensitivity(final InterestRateFutureOptionMarginTransaction transaction, final SABRSTIRFuturesProviderInterface sabrData);  }
@Test public void presentValueSABRSensitivity() { final PresentValueSABRSensitivityDataBundle pvcs = METHOD_SABR_TRA.presentValueSABRSensitivity(TRANSACTION, SABR_MULTICURVES); final double pv = METHOD_SABR_TRA.presentValue(TRANSACTION, SABR_MULTICURVES).getAmount(EUR); final double shift = 0.000001; final double delay = EDU2.getTradingLastTime() - OPTION_EDU2.getExpirationTime(); final DoublesPair expectedExpiryDelay = DoublesPair.of(OPTION_EDU2.getExpirationTime(), delay); final SABRInterestRateParameters sabrParameterAlphaBumped = SABRDataSets.createSABR1AlphaBumped(shift); final SABRSTIRFuturesProviderDiscount sabrBundleAlphaBumped = new SABRSTIRFuturesProviderDiscount(MULTICURVES, sabrParameterAlphaBumped, EURIBOR3M); final double pvAlphaBumped = METHOD_SABR_TRA.presentValue(TRANSACTION, sabrBundleAlphaBumped).getAmount(EUR); final double expectedAlphaSensi = (pvAlphaBumped - pv) / shift; assertEquals("Number of alpha sensitivity", pvcs.getAlpha().getMap().keySet().size(), 1); assertEquals("Alpha sensitivity expiry/tenor", pvcs.getAlpha().getMap().keySet().contains(expectedExpiryDelay), true); assertEquals("Alpha sensitivity value", pvcs.getAlpha().getMap().get(expectedExpiryDelay), expectedAlphaSensi, 1.0E+1); final SABRInterestRateParameters sabrParameterRhoBumped = SABRDataSets.createSABR1RhoBumped(shift); final SABRSTIRFuturesProviderDiscount sabrBundleRhoBumped = new SABRSTIRFuturesProviderDiscount(MULTICURVES, sabrParameterRhoBumped, EURIBOR3M); final double pvRhoBumped = METHOD_SABR_TRA.presentValue(TRANSACTION, sabrBundleRhoBumped).getAmount(EUR); final double expectedRhoSensi = (pvRhoBumped - pv) / shift; assertEquals("Number of rho sensitivity", pvcs.getRho().getMap().keySet().size(), 1); assertEquals("Rho sensitivity expiry/tenor", pvcs.getRho().getMap().keySet().contains(expectedExpiryDelay), true); assertEquals("Rho sensitivity value", pvcs.getRho().getMap().get(expectedExpiryDelay), expectedRhoSensi, 1.0E+0); final SABRInterestRateParameters sabrParameterNuBumped = SABRDataSets.createSABR1NuBumped(shift); final SABRSTIRFuturesProviderDiscount sabrBundleNuBumped = new SABRSTIRFuturesProviderDiscount(MULTICURVES, sabrParameterNuBumped, EURIBOR3M); final double pvNuBumped = METHOD_SABR_TRA.presentValue(TRANSACTION, sabrBundleNuBumped).getAmount(EUR); final double expectedNuSensi = (pvNuBumped - pv) / shift; assertEquals("Number of nu sensitivity", pvcs.getNu().getMap().keySet().size(), 1); assertEquals("Nu sensitivity expiry/tenor", pvcs.getNu().getMap().keySet().contains(expectedExpiryDelay), true); assertEquals("Nu sensitivity value", pvcs.getNu().getMap().get(expectedExpiryDelay), expectedNuSensi, 1.0E+0); }