Exemplo n.º 1
0
        public void TestDelta0Coupon()
        {
            for (var i = 1; i < 10; i++)
            {
                var delta0 = SwapAnalytics.Delta0Coupon(1000000.0, 0.25, 0.07, Math.Exp(-0.07 * i));
                Debug.WriteLine(String.Format("Delta1 : {0} Time: {1}", delta0, i));
            }

        }
Exemplo n.º 2
0
        public void Delta0CouponTest()
        {
            const double notional              = 100;
            const double dayFraction           = 0.5;    // 6 months
            const double rate                  = 0.0615; // 6.15%
            const double paymentDiscountFactor = 0.92;
            const double expected              = -0.0046;
            double       actual                = SwapAnalytics.Delta0Coupon(notional, dayFraction, rate, paymentDiscountFactor);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Evaluates the delta wrt the forward rate R.
 /// </summary>
 /// <param name="notional">The notional for that period.</param>
 /// <param name="paymentDiscountFactor">The payment discount factor.</param>
 /// <param name="dayFraction">The year fraction.</param>
 /// <param name="rate">The rate.</param>
 /// <returns></returns>
 public double Delta0Coupon(double notional, double dayFraction, double rate, double paymentDiscountFactor)
 {
     return(SwapAnalytics.Delta0Coupon(notional, dayFraction, rate, paymentDiscountFactor));
 }