Ejemplo n.º 1
0
        /// <summary>
        /// Test for the case where publication lag=0, effective offset=0 (GBP conventions) and no cutoff period.
        ///   The arithmetic average coupons are used mainly in USD. This test is more for completeness than a real case.
        /// </summary>
        public virtual void rateGbpNoCutOffSensitivity()
        {
            OvernightIndexRates mockRates = mock(typeof(OvernightIndexRates));

            when(mockRates.Index).thenReturn(GBP_SONIA);
            SimpleRatesProvider simpleProv = new SimpleRatesProvider(mockRates);

            for (int i = 0; i < GBP_OBS.Length; i++)
            {
                when(mockRates.rate(GBP_OBS[i])).thenReturn(FIXING_RATES[i]);
                OvernightRateSensitivity sensitivity = OvernightRateSensitivity.of(GBP_OBS[i], GBP_SONIA.Currency, 1d);
                when(mockRates.ratePointSensitivity(GBP_OBS[i])).thenReturn(sensitivity);
            }
            OvernightAveragedRateComputation          ro       = OvernightAveragedRateComputation.of(GBP_SONIA, START_DATE, END_DATE, 0, REF_DATA);
            ForwardOvernightAveragedRateComputationFn obsFn    = ForwardOvernightAveragedRateComputationFn.DEFAULT;
            PointSensitivityBuilder sensitivityBuilderComputed = obsFn.rateSensitivity(ro, DUMMY_ACCRUAL_START_DATE, DUMMY_ACCRUAL_END_DATE, simpleProv);
            PointSensitivities      sensitivityComputed        = sensitivityBuilderComputed.build().normalized();

            double?[] sensitivityExpected = computedSensitivityFD(ro, GBP_SONIA, GBP_OBS);
            assertEquals(sensitivityComputed.Sensitivities.size(), sensitivityExpected.Length);
            for (int i = 0; i < sensitivityExpected.Length; ++i)
            {
                assertEquals(sensitivityComputed.Sensitivities.get(i).Sensitivity, sensitivityExpected[i], EPS_FD);
            }
        }
            internal LocalDate nextFixing;                   // Running variable through the different methods: next fixing date to be analyzed

            internal ObservationDetails(OvernightCompoundedRateComputation computation, OvernightIndexRates rates)
            {
                this.computation           = computation;
                this.rates                 = rates;
                this.indexFixingDateSeries = rates.Fixings;
                this.dayCount              = computation.Index.DayCount;
                // Details of the cutoff period
                this.firstFixing         = computation.StartDate;
                this.lastFixingP1        = computation.EndDate;
                this.lastFixing          = computation.FixingCalendar.previous(lastFixingP1);
                this.cutoffOffset        = Math.Max(computation.RateCutOffDays, 1);
                this.accrualFactorCutoff = new double[cutoffOffset - 1];
                LocalDate currentFixing = lastFixing;

                for (int i = 0; i < cutoffOffset - 1; i++)
                {
                    currentFixing = computation.FixingCalendar.previous(currentFixing);
                    LocalDate effectiveDate = computation.calculateEffectiveFromFixing(currentFixing);
                    LocalDate maturityDate  = computation.calculateMaturityFromEffective(effectiveDate);
                    accrualFactorCutoff[i] = dayCount.yearFraction(effectiveDate, maturityDate);
                }
                this.lastFixingNonCutoff = currentFixing;
                LocalDate startUnderlyingPeriod = computation.calculateEffectiveFromFixing(firstFixing);
                LocalDate endUnderlyingPeriod   = computation.calculateMaturityFromFixing(lastFixing);

                this.accrualFactorTotal = dayCount.yearFraction(startUnderlyingPeriod, endUnderlyingPeriod);
            }
        //-------------------------------------------------------------------------
        // Compute the approximated rate in the case where the whole period is forward.
        // There is no need to compute overnight periods, except for the cut-off period.
        private double rateForward(OvernightAveragedRateComputation computation, OvernightIndexRates rates)
        {
            OvernightIndex  index                 = computation.Index;
            HolidayCalendar calendar              = computation.FixingCalendar;
            LocalDate       startFixingDate       = computation.StartDate;
            LocalDate       endFixingDateP1       = computation.EndDate;
            LocalDate       endFixingDate         = calendar.previous(endFixingDateP1);
            LocalDate       onRateEndDate         = computation.calculateMaturityFromFixing(endFixingDate);
            LocalDate       onRateStartDate       = computation.calculateEffectiveFromFixing(startFixingDate);
            LocalDate       onRateNoCutOffEndDate = onRateEndDate;
            int             cutoffOffset          = computation.RateCutOffDays > 1 ? computation.RateCutOffDays : 1;
            double          accumulatedInterest   = 0.0d;
            double          accrualFactorTotal    = index.DayCount.yearFraction(onRateStartDate, onRateEndDate);

            if (cutoffOffset > 1)
            {     // Cut-off period
                LocalDate currentFixingDate            = endFixingDate;
                OvernightIndexObservation lastIndexObs = null;
                double cutOffAccrualFactorTotal        = 0d;
                for (int i = 1; i < cutoffOffset; i++)
                {
                    currentFixingDate         = calendar.previous(currentFixingDate);
                    lastIndexObs              = computation.observeOn(currentFixingDate);
                    onRateNoCutOffEndDate     = lastIndexObs.MaturityDate;
                    cutOffAccrualFactorTotal += lastIndexObs.YearFraction;
                }
                double forwardRateCutOff = rates.rate(lastIndexObs);
                accumulatedInterest += cutOffAccrualFactorTotal * forwardRateCutOff;
            }
            // Approximated part
            accumulatedInterest += approximatedInterest(computation.observeOn(onRateStartDate), onRateNoCutOffEndDate, rates);
            // final rate
            return(accumulatedInterest / accrualFactorTotal);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Test for the case where publication lag=1, effective offset=0 (USD conventions) and cutoff=2 (FedFund swaps). </summary>
        public virtual void rateFedFund()
        {
            OvernightIndexRates mockRates = mock(typeof(OvernightIndexRates));

            when(mockRates.Index).thenReturn(USD_FED_FUND);
            SimpleRatesProvider simpleProv = new SimpleRatesProvider(mockRates);

            for (int i = 0; i < USD_OBS.Length; i++)
            {
                when(mockRates.rate(USD_OBS[i])).thenReturn(FIXING_RATES[i]);
            }
            OvernightAveragedRateComputation          ro    = OvernightAveragedRateComputation.of(USD_FED_FUND, START_DATE, END_DATE, 2, REF_DATA);
            ForwardOvernightAveragedRateComputationFn obsFn = ForwardOvernightAveragedRateComputationFn.DEFAULT;
            double accrualFactorTotal = 0.0d;
            double accruedRate        = 0.0d;
            int    indexLast          = 5; // Fixing in the observation period are from 1 to 5 (inclusive), but last is modified by cut-off

            for (int i = 1; i <= indexLast - 1; i++)
            {
                LocalDate endDate = USD_OBS[i].MaturityDate;
                double    af      = USD_FED_FUND.DayCount.yearFraction(FIXING_DATES[i], endDate);
                accrualFactorTotal += af;
                accruedRate        += FIXING_RATES[i] * af;
            }
            // CutOff
            LocalDate endDate = USD_OBS[indexLast].MaturityDate;
            double    af      = USD_FED_FUND.DayCount.yearFraction(FIXING_DATES[indexLast], endDate);

            accrualFactorTotal += af;
            accruedRate        += FIXING_RATES[indexLast - 1] * af;
            double rateExpected = accruedRate / accrualFactorTotal;
            double rateComputed = obsFn.rate(ro, DUMMY_ACCRUAL_START_DATE, DUMMY_ACCRUAL_END_DATE, simpleProv);

            assertEquals(rateExpected, rateComputed, TOLERANCE_RATE);
        }
            // Construct all the details related to the observation: fixing dates, publication dates, start and end dates,
            // accrual factors, number of already fixed ON rates.
            internal ObservationDetails(OvernightAveragedRateComputation computation, OvernightIndexRates rates)
            {
                this.index = computation.Index;
                this.rates = rates;
                LocalDate startFixingDate = computation.StartDate;
                LocalDate endFixingDateP1 = computation.EndDate;

                this.cutoffOffset = computation.RateCutOffDays > 1 ? computation.RateCutOffDays : 1;
                double accrualFactorAccumulated = 0d;
                // find all observations in the period
                LocalDate currentFixing = startFixingDate;
                IList <OvernightIndexObservation> indexObsList = new List <OvernightIndexObservation>();

                while (currentFixing.isBefore(endFixingDateP1))
                {
                    OvernightIndexObservation indexObs = computation.observeOn(currentFixing);
                    indexObsList.Add(indexObs);
                    currentFixing             = computation.FixingCalendar.next(currentFixing);
                    accrualFactorAccumulated += indexObs.YearFraction;
                }
                this.accrualFactorTotal = accrualFactorAccumulated;
                this.nbPeriods          = indexObsList.Count;
                // dealing with cut-off by replacing observations with ones where fixing/publication locked
                // within cut-off, the effective/maturity dates of each observation have to stay the same
                for (int i = 0; i < cutoffOffset - 1; i++)
                {
                    OvernightIndexObservation fixingIndexObs  = indexObsList[nbPeriods - cutoffOffset];
                    OvernightIndexObservation cutoffIndexObs  = indexObsList[nbPeriods - 1 - i];
                    OvernightIndexObservation updatedIndexObs = cutoffIndexObs.toBuilder().fixingDate(fixingIndexObs.FixingDate).publicationDate(fixingIndexObs.PublicationDate).build();
                    indexObsList[nbPeriods - 1 - i] = updatedIndexObs;
                }
                this.observations = Collections.unmodifiableList(indexObsList);
            }
Ejemplo n.º 6
0
        /// <summary>
        /// Test for the case where publication lag=0, effective offset=0 (GBP conventions) and no cutoff period.
        ///   The arithmetic average coupons are used mainly in USD. This test is more for completeness than a real case.
        /// </summary>
        public virtual void rateGbpNoCutOff()
        {
            OvernightIndexRates mockRates = mock(typeof(OvernightIndexRates));

            when(mockRates.Index).thenReturn(GBP_SONIA);
            SimpleRatesProvider simpleProv = new SimpleRatesProvider(mockRates);

            for (int i = 0; i < GBP_OBS.Length; i++)
            {
                when(mockRates.rate(GBP_OBS[i])).thenReturn(FIXING_RATES[i]);
            }
            OvernightAveragedRateComputation          ro    = OvernightAveragedRateComputation.of(GBP_SONIA, START_DATE, END_DATE, 0, REF_DATA);
            ForwardOvernightAveragedRateComputationFn obsFn = ForwardOvernightAveragedRateComputationFn.DEFAULT;
            double accrualFactorTotal = 0.0d;
            double accruedRate        = 0.0d;
            int    indexLast          = 5; // Fixing in the observation period are from 1 to 5 (inclusive)

            for (int i = 1; i <= indexLast; i++)
            {
                LocalDate startDate = GBP_OBS[i].EffectiveDate;
                LocalDate endDate   = GBP_OBS[i].MaturityDate;
                double    af        = GBP_SONIA.DayCount.yearFraction(startDate, endDate);
                accrualFactorTotal += af;
                accruedRate        += FIXING_RATES[i] * af;
            }
            double rateExpected = accruedRate / accrualFactorTotal;
            double rateComputed = obsFn.rate(ro, DUMMY_ACCRUAL_START_DATE, DUMMY_ACCRUAL_END_DATE, simpleProv);

            assertEquals(rateExpected, rateComputed, TOLERANCE_RATE);
        }
        public virtual PointSensitivityBuilder rateSensitivity(OvernightCompoundedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
        {
            OvernightIndexRates rates   = provider.overnightIndexRates(computation.Index);
            ObservationDetails  details = new ObservationDetails(computation, rates);

            return(details.calculateRateSensitivity());
        }
        public virtual void merge_content_2()
        {
            ImmutableRatesProvider test1  = ImmutableRatesProvider.builder(VAL_DATE).discountCurve(GBP, DISCOUNT_CURVE_GBP).timeSeries(GBP_USD_WM, TS).build();
            ImmutableRatesProvider test2  = ImmutableRatesProvider.builder(VAL_DATE).discountCurve(USD, DISCOUNT_CURVE_USD).iborIndexCurve(USD_LIBOR_3M, USD_LIBOR_CURVE).overnightIndexCurve(USD_FED_FUND, FED_FUND_CURVE).priceIndexCurve(GB_RPI, GBPRI_CURVE).timeSeries(GB_RPI, TS).build();
            ImmutableRatesProvider merged = ImmutableRatesProvider.combined(FX_MATRIX, test1, test2);

            assertEquals(merged.ValuationDate, VAL_DATE);
            assertEquals(merged.discountFactors(USD), DiscountFactors.of(USD, VAL_DATE, DISCOUNT_CURVE_USD));
            assertEquals(merged.discountFactors(GBP), DiscountFactors.of(GBP, VAL_DATE, DISCOUNT_CURVE_GBP));
            assertEquals(merged.iborIndexRates(USD_LIBOR_3M), IborIndexRates.of(USD_LIBOR_3M, VAL_DATE, USD_LIBOR_CURVE));
            assertEquals(merged.overnightIndexRates(USD_FED_FUND), OvernightIndexRates.of(USD_FED_FUND, VAL_DATE, FED_FUND_CURVE));
            assertEquals(merged.priceIndexValues(GB_RPI), PriceIndexValues.of(GB_RPI, VAL_DATE, GBPRI_CURVE, TS));
            assertEquals(merged.timeSeries(GBP_USD_WM), TS);
            assertEquals(merged.FxRateProvider, FX_MATRIX);
        }
        public virtual PointSensitivityBuilder rateSensitivity(OvernightAveragedRateComputation computation, LocalDate startDate, LocalDate endDate, RatesProvider provider)
        {
            OvernightIndexRates rates                = provider.overnightIndexRates(computation.Index);
            LocalDate           valuationDate        = rates.ValuationDate;
            LocalDate           startFixingDate      = computation.StartDate;
            LocalDate           startPublicationDate = computation.calculatePublicationFromFixing(startFixingDate);

            // No fixing to analyze. Go directly to approximation and cut-off.
            if (valuationDate.isBefore(startPublicationDate))
            {
                return(rateForwardSensitivity(computation, rates));
            }
            ObservationDetails details = new ObservationDetails(computation, rates);

            return(details.calculateRateSensitivity());
        }
Ejemplo n.º 10
0
        private double?[] computedSensitivityFD(OvernightAveragedRateComputation ro, OvernightIndex index, OvernightIndexObservation[] indexObs)
        {
            int nRates = FIXING_DATES.Length;

            OvernightIndexRates[] mockRatesUp  = new OvernightIndexRates[nRates];
            SimpleRatesProvider[] simpleProvUp = new SimpleRatesProvider[nRates];
            OvernightIndexRates[] mockRatesDw  = new OvernightIndexRates[nRates];
            SimpleRatesProvider[] simpleProvDw = new SimpleRatesProvider[nRates];
            double[][]            ratesUp      = new double[nRates][];
            double[][]            ratesDw      = new double[nRates][];
            for (int i = 0; i < nRates; ++i)
            {
                mockRatesUp[i]  = mock(typeof(OvernightIndexRates));
                simpleProvUp[i] = new SimpleRatesProvider(mockRatesUp[i]);
                mockRatesDw[i]  = mock(typeof(OvernightIndexRates));
                simpleProvDw[i] = new SimpleRatesProvider(mockRatesDw[i]);
                ratesUp[i]      = Arrays.copyOf(FIXING_RATES, nRates);
                ratesDw[i]      = Arrays.copyOf(FIXING_RATES, nRates);
                ratesUp[i][i]  += EPS_FD;
                ratesDw[i][i]  -= EPS_FD;
            }
            for (int i = 0; i < nRates; i++)
            {
                for (int j = 0; j < nRates; ++j)
                {
                    when(mockRatesUp[j].rate(indexObs[i])).thenReturn(ratesUp[j][i]);
                    when(mockRatesDw[j].rate(indexObs[i])).thenReturn(ratesDw[j][i]);
                }
            }
            ForwardOvernightAveragedRateComputationFn obsFn = ForwardOvernightAveragedRateComputationFn.DEFAULT;
            IList <double> sensitivityExpected = new List <double>();

            for (int i = 0; i < nRates; ++i)
            {
                double rateUp = obsFn.rate(ro, DUMMY_ACCRUAL_START_DATE, DUMMY_ACCRUAL_END_DATE, simpleProvUp[i]);
                double rateDw = obsFn.rate(ro, DUMMY_ACCRUAL_START_DATE, DUMMY_ACCRUAL_END_DATE, simpleProvDw[i]);
                double res    = 0.5 * (rateUp - rateDw) / EPS_FD;
                if (Math.Abs(res) > 1.0e-14)
                {
                    sensitivityExpected.Add(res);
                }
            }
            int size = sensitivityExpected.Count;

            double?[] result = new double?[size];
            return(sensitivityExpected.toArray(result));
        }
        //-------------------------------------------------------------------------
        public virtual void test_of_withoutFixings()
        {
            DiscountOvernightIndexRates test = DiscountOvernightIndexRates.of(GBP_SONIA, DFCURVE);

            assertEquals(test.Index, GBP_SONIA);
            assertEquals(test.ValuationDate, DATE_VAL);
            assertEquals(test.Fixings, SERIES_EMPTY);
            assertEquals(test.DiscountFactors, DFCURVE);
            assertEquals(test.ParameterCount, DFCURVE.ParameterCount);
            assertEquals(test.getParameter(0), DFCURVE.getParameter(0));
            assertEquals(test.getParameterMetadata(0), DFCURVE.getParameterMetadata(0));
            assertEquals(test.withParameter(0, 1d).DiscountFactors, DFCURVE.withParameter(0, 1d));
            assertEquals(test.withPerturbation((i, v, m) => v + 1d).DiscountFactors, DFCURVE.withPerturbation((i, v, m) => v + 1d));
            assertEquals(test.findData(CURVE.Name), CURVE);
            assertEquals(test.findData(CurveName.of("Rubbish")), null);
            // check IborIndexRates
            OvernightIndexRates test2 = OvernightIndexRates.of(GBP_SONIA, DATE_VAL, CURVE);

            assertEquals(test, test2);
        }
Ejemplo n.º 12
0
        //-------------------------------------------------------------------------
        /// <summary>
        /// Test for the case where publication lag=1, effective offset=0 (USD conventions) and no cutoff period. </summary>
        public virtual void rateFedFundNoCutOff()
        {
            OvernightIndexRates mockRates = mock(typeof(OvernightIndexRates));

            when(mockRates.Index).thenReturn(USD_FED_FUND);
            SimpleRatesProvider simpleProv = new SimpleRatesProvider(mockRates);

            for (int i = 0; i < USD_OBS.Length; i++)
            {
                when(mockRates.rate(USD_OBS[i])).thenReturn(FIXING_RATES[i]);
            }
            OvernightAveragedRateComputation ro = OvernightAveragedRateComputation.of(USD_FED_FUND, START_DATE, END_DATE, 0, REF_DATA);
            // Accrual dates = fixing dates
            ForwardOvernightAveragedRateComputationFn obsFn = ForwardOvernightAveragedRateComputationFn.DEFAULT;
            double accrualFactorTotal = 0.0d;
            double accruedRate        = 0.0d;
            int    indexLast          = 5; // Fixing in the observation period are from 1 to 5 (inclusive)

            for (int i = 1; i <= indexLast; i++)
            {
                LocalDate endDate = USD_OBS[i].MaturityDate;
                double    af      = USD_FED_FUND.DayCount.yearFraction(FIXING_DATES[i], endDate);
                accrualFactorTotal += af;
                accruedRate        += FIXING_RATES[i] * af;
            }
            double rateExpected = accruedRate / accrualFactorTotal;
            double rateComputed = obsFn.rate(ro, DUMMY_ACCRUAL_START_DATE, DUMMY_ACCRUAL_END_DATE, simpleProv);

            assertEquals(rateExpected, rateComputed, TOLERANCE_RATE);

            // explain
            ExplainMapBuilder builder       = ExplainMap.builder();
            double            explainedRate = obsFn.explainRate(ro, DUMMY_ACCRUAL_START_DATE, DUMMY_ACCRUAL_END_DATE, simpleProv, builder);

            assertEquals(explainedRate, rateExpected, TOLERANCE_RATE);

            ExplainMap built = builder.build();

            assertEquals(built.get(ExplainKey.OBSERVATIONS).Present, false);
            assertEquals(built.get(ExplainKey.COMBINED_RATE).Value.doubleValue(), rateExpected, TOLERANCE_RATE);
        }
        // Compute the accrued interest sensitivity on a given period by approximation
        private static PointSensitivityBuilder approximatedInterestSensitivity(OvernightIndexObservation observation, LocalDate endDate, OvernightIndexRates rates)
        {
            DayCount dayCount = observation.Index.DayCount;
            double   remainingFixingAccrualFactor = dayCount.yearFraction(observation.EffectiveDate, endDate);
            double   forwardRate = rates.periodRate(observation, endDate);
            PointSensitivityBuilder forwardRateSensitivity = rates.periodRatePointSensitivity(observation, endDate);
            double rateExp = 1.0 + forwardRate * remainingFixingAccrualFactor;

            forwardRateSensitivity = forwardRateSensitivity.multipliedBy(remainingFixingAccrualFactor / rateExp);
            return(forwardRateSensitivity);
        }
        // Compute the accrued interest on a given period by approximation
        private static double approximatedInterest(OvernightIndexObservation observation, LocalDate endDate, OvernightIndexRates rates)
        {
            DayCount dayCount = observation.Index.DayCount;
            double   remainingFixingAccrualFactor = dayCount.yearFraction(observation.EffectiveDate, endDate);
            double   forwardRate = rates.periodRate(observation, endDate);

            return(Math.Log(1.0 + forwardRate * remainingFixingAccrualFactor));
        }
        private PointSensitivityBuilder rateForwardSensitivity(OvernightAveragedRateComputation computation, OvernightIndexRates rates)
        {
            OvernightIndex          index                           = computation.Index;
            HolidayCalendar         calendar                        = computation.FixingCalendar;
            LocalDate               startFixingDate                 = computation.StartDate;
            LocalDate               endFixingDateP1                 = computation.EndDate;
            LocalDate               endFixingDate                   = calendar.previous(endFixingDateP1);
            LocalDate               onRateEndDate                   = computation.calculateMaturityFromFixing(endFixingDate);
            LocalDate               onRateStartDate                 = computation.calculateEffectiveFromFixing(startFixingDate);
            LocalDate               lastNonCutOffMatDate            = onRateEndDate;
            int                     cutoffOffset                    = computation.RateCutOffDays > 1 ? computation.RateCutOffDays : 1;
            PointSensitivityBuilder combinedPointSensitivityBuilder = PointSensitivityBuilder.none();
            double                  accrualFactorTotal              = index.DayCount.yearFraction(onRateStartDate, onRateEndDate);

            if (cutoffOffset > 1)
            {     // Cut-off period
                IList <double> noCutOffAccrualFactorList = new List <double>();
                LocalDate      currentFixingDate         = endFixingDateP1;
                LocalDate      cutOffEffectiveDate;
                for (int i = 0; i < cutoffOffset; i++)
                {
                    currentFixingDate    = calendar.previous(currentFixingDate);
                    cutOffEffectiveDate  = computation.calculateEffectiveFromFixing(currentFixingDate);
                    lastNonCutOffMatDate = computation.calculateMaturityFromEffective(cutOffEffectiveDate);
                    double accrualFactor = index.DayCount.yearFraction(cutOffEffectiveDate, lastNonCutOffMatDate);
                    noCutOffAccrualFactorList.Add(accrualFactor);
                }
                OvernightIndexObservation lastIndexObs = computation.observeOn(currentFixingDate);
                PointSensitivityBuilder   forwardRateCutOffSensitivity = rates.ratePointSensitivity(lastIndexObs);
                double totalAccrualFactor = 0.0;
                for (int i = 0; i < cutoffOffset - 1; i++)
                {
                    totalAccrualFactor += noCutOffAccrualFactorList[i];
                }
                forwardRateCutOffSensitivity    = forwardRateCutOffSensitivity.multipliedBy(totalAccrualFactor);
                combinedPointSensitivityBuilder = combinedPointSensitivityBuilder.combinedWith(forwardRateCutOffSensitivity);
            }
            // Approximated part
            OvernightIndexObservation indexObs = computation.observeOn(onRateStartDate);
            PointSensitivityBuilder   approximatedInterestAndSensitivity = approximatedInterestSensitivity(indexObs, lastNonCutOffMatDate, rates);

            combinedPointSensitivityBuilder = combinedPointSensitivityBuilder.combinedWith(approximatedInterestAndSensitivity);
            combinedPointSensitivityBuilder = combinedPointSensitivityBuilder.multipliedBy(1.0 / accrualFactorTotal);
            // final rate
            return(combinedPointSensitivityBuilder);
        }
Ejemplo n.º 16
0
 public SimpleRatesProvider(LocalDate valuationDate, OvernightIndexRates overnightRates)
 {
     this.valuationDate  = valuationDate;
     this.overnightRates = overnightRates;
 }
Ejemplo n.º 17
0
 public SimpleRatesProvider(OvernightIndexRates overnightRates)
 {
     this.overnightRates = overnightRates;
 }