Ejemplo n.º 1
0
        public virtual void test_presentValueSensitivityModelParamsSabr()
        {
            PointSensitivityBuilder computed1 = PRICER.presentValueSensitivityModelParamsSabr(CAP_ONE_LEG, RATES, VOLS);
            PointSensitivityBuilder computed2 = PRICER.presentValueSensitivityModelParamsSabr(CAP_TWO_LEGS, RATES, VOLS);
            PointSensitivityBuilder cap       = PRICER_CAP_LEG.presentValueSensitivityModelParamsSabr(CAP_LEG, RATES, VOLS);

            assertEquals(computed1, cap);
            assertEquals(computed2, cap);
        }
Ejemplo n.º 2
0
        public virtual void test_presentValueSensitivityModelParamsSabr()
        {
            PointSensitivities computedWithPayLeg  = PRICER.presentValueSensitivityModelParamsSabr(TRADE_PAYLEG, RATES, VOLS).build();
            PointSensitivities computedWithPremium = PRICER.presentValueSensitivityModelParamsSabr(TRADE_PREMIUM, RATES, VOLS).build();
            PointSensitivities pvOneLeg            = PRICER_PRODUCT.presentValueSensitivityModelParamsSabr(CAP_ONE_LEG, RATES, VOLS).build();
            PointSensitivities pvTwoLegs           = PRICER_PRODUCT.presentValueSensitivityModelParamsSabr(CAP_TWO_LEGS, RATES, VOLS).build();

            assertEquals(computedWithPayLeg, pvTwoLegs);
            assertEquals(computedWithPremium, pvOneLeg);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Calculates the present value volatility sensitivity of the Ibor cap/floor trade.
 /// <para>
 /// The sensitivity of the present value to the SABR model parameters, alpha, beta, rho and nu.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the Ibor cap/floor trade </param>
 /// <param name="ratesProvider">  the rates provider </param>
 /// <param name="volatilities">  the volatilities </param>
 /// <returns> the present value sensitivity </returns>
 public virtual PointSensitivityBuilder presentValueSensitivityModelParamsSabr(ResolvedIborCapFloorTrade trade, RatesProvider ratesProvider, SabrIborCapletFloorletVolatilities volatilities)
 {
     return(productPricer.presentValueSensitivityModelParamsSabr(trade.Product, ratesProvider, volatilities));
 }