Пример #1
0
        public virtual void test_valuePointSensitivity_forward()
        {
            YearMonth month = VAL_MONTH.plusMonths(3);
            SimplePriceIndexValues   test     = SimplePriceIndexValues.of(US_CPI_U, VAL_DATE, CURVE_NOFIX, USCPI_TS);
            PriceIndexObservation    obs      = PriceIndexObservation.of(US_CPI_U, month);
            InflationRateSensitivity expected = InflationRateSensitivity.of(obs, 1d);

            assertEquals(test.valuePointSensitivity(obs), expected);
        }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            AbsoluteIborFutureTemplate test = AbsoluteIborFutureTemplate.of(YEAR_MONTH, CONVENTION);

            coverImmutableBean(test);
            AbsoluteIborFutureTemplate test2 = AbsoluteIborFutureTemplate.of(YEAR_MONTH.plusMonths(1), CONVENTION2);

            coverBeanEquals(test, test2);
        }
Пример #3
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            PriceIndexObservation test = PriceIndexObservation.of(GB_HICP, FIXING_MONTH);

            coverImmutableBean(test);
            PriceIndexObservation test2 = PriceIndexObservation.of(CH_CPI, FIXING_MONTH.plusMonths(1));

            coverBeanEquals(test, test2);
        }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates an instance from an index, reference start month and reference end month.
 /// <para>
 /// The second start/end observations will be one month later than the start/end month.
 ///
 /// </para>
 /// </summary>
 /// <param name="index">  the index </param>
 /// <param name="referenceStartMonth">  the reference start month </param>
 /// <param name="referenceEndMonth">  the reference end month </param>
 /// <param name="weight">  the weight </param>
 /// <returns> the inflation rate computation </returns>
 public static InflationInterpolatedRateComputation of(PriceIndex index, YearMonth referenceStartMonth, YearMonth referenceEndMonth, double weight)
 {
     return(new InflationInterpolatedRateComputation(PriceIndexObservation.of(index, referenceStartMonth), PriceIndexObservation.of(index, referenceStartMonth.plusMonths(1)), PriceIndexObservation.of(index, referenceEndMonth), PriceIndexObservation.of(index, referenceEndMonth.plusMonths(1)), weight));
 }