Ejemplo n.º 1
0
        //-------------------------------------------------------------------------
        public virtual void test_discountFactor()
        {
            IsdaCreditDiscountFactors test = IsdaCreditDiscountFactors.of(USD, VALUATION, CURVE);
            double relativeYearFraction    = ACT_365F.relativeYearFraction(VALUATION, DATE_AFTER);
            double expected = Math.Exp(-relativeYearFraction * CURVE.yValue(relativeYearFraction));

            assertEquals(test.discountFactor(DATE_AFTER), expected);
        }
Ejemplo n.º 2
0
        public virtual void test_zeroRate()
        {
            IsdaCreditDiscountFactors test = IsdaCreditDiscountFactors.of(USD, VALUATION, CURVE);
            double relativeYearFraction    = ACT_365F.relativeYearFraction(VALUATION, DATE_AFTER);
            double discountFactor          = test.discountFactor(DATE_AFTER);
            double zeroRate = test.zeroRate(DATE_AFTER);

            assertEquals(Math.Exp(-zeroRate * relativeYearFraction), discountFactor);
        }