/// <summary>
 /// Creates an instance.
 /// </summary>
 /// <param name="trades">  the trades </param>
 /// <param name="measures">  the calibration measures </param>
 /// <param name="providerGenerator">  the provider generator, used to create child providers </param>
 /// <param name="curveOrder">  the curve order </param>
 public CalibrationDerivative(IList <ResolvedTrade> trades, CalibrationMeasures measures, RatesProviderGenerator providerGenerator, IList <CurveParameterSize> curveOrder)
 {
     this.measures          = measures;
     this.trades            = trades;
     this.providerGenerator = providerGenerator;
     this.curveOrder        = curveOrder;
 }
Beispiel #2
0
        public virtual void test_of_list()
        {
            CalibrationMeasures test = CalibrationMeasures.of("Test", ImmutableList.of(TradeCalibrationMeasure.FRA_PAR_SPREAD, TradeCalibrationMeasure.SWAP_PAR_SPREAD));

            assertThat(test.Name).isEqualTo("Test");
            assertThat(test.TradeTypes).containsOnly(typeof(ResolvedFraTrade), typeof(ResolvedSwapTrade));
            assertThat(test.ToString()).isEqualTo("Test");
        }
Beispiel #3
0
 /// <summary>
 /// Creates an instance.
 /// </summary>
 /// <param name="trades">  the trades </param>
 /// <param name="measures">  the calibration measures </param>
 /// <param name="providerGenerator">  the provider generator, used to create child providers </param>
 internal CalibrationValue(IList <ResolvedTrade> trades, CalibrationMeasures measures, RatesProviderGenerator providerGenerator)
 {
     this.trades            = trades;
     this.measures          = measures;
     this.providerGenerator = providerGenerator;
 }
 //-------------------------------------------------------------------------
 // restricted constructor
 private RatesCurveCalibrator(NewtonVectorRootFinder rootFinder, CalibrationMeasures measures, CalibrationMeasures pvMeasures)
 {
     this.rootFinder = ArgChecker.notNull(rootFinder, "rootFinder");
     this.measures   = ArgChecker.notNull(measures, "measures");
     this.pvMeasures = ArgChecker.notNull(pvMeasures, "pvMeasures");
 }
 /// <summary>
 /// Obtains an instance specifying the measures to use.
 /// </summary>
 /// <param name="rootFinder">  the root finder to use </param>
 /// <param name="measures">  the calibration measures, used to compute the function for which the root is found </param>
 /// <param name="pvMeasures">  the present value measures, used to compute the present value sensitivity to market quotes
 ///   stored in the metadata </param>
 /// <returns> the curve calibrator </returns>
 public static RatesCurveCalibrator of(NewtonVectorRootFinder rootFinder, CalibrationMeasures measures, CalibrationMeasures pvMeasures)
 {
     return(new RatesCurveCalibrator(rootFinder, measures, pvMeasures));
 }
        /// <summary>
        /// Obtains an instance specifying tolerances and measures to use.
        /// <para>
        /// This uses a Broyden root finder.
        ///
        /// </para>
        /// </summary>
        /// <param name="toleranceAbs">  the absolute tolerance </param>
        /// <param name="toleranceRel">  the relative tolerance </param>
        /// <param name="stepMaximum">  the maximum steps </param>
        /// <param name="measures">  the calibration measures, used to compute the function for which the root is found </param>
        /// <param name="pvMeasures">  the present value measures, used to compute the present value sensitivity to market quotes
        ///   stored in the metadata </param>
        /// <returns> the curve calibrator </returns>
        public static RatesCurveCalibrator of(double toleranceAbs, double toleranceRel, int stepMaximum, CalibrationMeasures measures, CalibrationMeasures pvMeasures)
        {
            NewtonVectorRootFinder rootFinder = NewtonVectorRootFinder.broyden(toleranceAbs, toleranceRel, stepMaximum);

            return(new RatesCurveCalibrator(rootFinder, measures, pvMeasures));
        }
 /// <summary>
 /// Obtains an instance specifying tolerances and measures to use.
 /// <para>
 /// This uses a Broyden root finder.
 /// The standard <seealso cref="CalibrationMeasures#PRESENT_VALUE"/> measures are used.
 ///
 /// </para>
 /// </summary>
 /// <param name="toleranceAbs">  the absolute tolerance </param>
 /// <param name="toleranceRel">  the relative tolerance </param>
 /// <param name="stepMaximum">  the maximum steps </param>
 /// <param name="measures">  the calibration measures, used to compute the function for which the root is found </param>
 /// <returns> the curve calibrator </returns>
 public static RatesCurveCalibrator of(double toleranceAbs, double toleranceRel, int stepMaximum, CalibrationMeasures measures)
 {
     return(of(toleranceAbs, toleranceRel, stepMaximum, measures, CalibrationMeasures.PRESENT_VALUE));
 }
Beispiel #8
0
        public virtual void test_measureNotKnown()
        {
            CalibrationMeasures test = CalibrationMeasures.of("Test", TradeCalibrationMeasure.FRA_PAR_SPREAD);

            assertThrowsIllegalArg(() => test.value(SwapDummyData.SWAP_TRADE, ImmutableRatesProviderSimpleData.IMM_PROV_EUR_FIX), "Trade type 'ResolvedSwapTrade' is not supported for calibration");
        }
Beispiel #9
0
 public virtual void test_of_duplicate()
 {
     assertThrowsIllegalArg(() => CalibrationMeasures.of("Test", TradeCalibrationMeasure.FRA_PAR_SPREAD, TradeCalibrationMeasure.FRA_PAR_SPREAD));
     assertThrowsIllegalArg(() => CalibrationMeasures.of("Test", ImmutableList.of(TradeCalibrationMeasure.FRA_PAR_SPREAD, TradeCalibrationMeasure.FRA_PAR_SPREAD)));
 }
Beispiel #10
0
 // restricted constructor
 private SyntheticRatesCurveCalibrator(RatesCurveCalibrator calibrator, CalibrationMeasures marketQuotesMeasures)
 {
     this.measures   = marketQuotesMeasures;
     this.calibrator = calibrator;
 }
Beispiel #11
0
 /// <summary>
 /// Obtains an instance, specifying market quotes measures to use and calibrator.
 /// </summary>
 /// <param name="calibrator">  the mechanism used to calibrate curves once the synthetic market quotes are known </param>
 /// <param name="marketQuotesMeasures">  the measures used to compute the market quotes </param>
 /// <returns> the synthetic curve calibrator </returns>
 public static SyntheticRatesCurveCalibrator of(RatesCurveCalibrator calibrator, CalibrationMeasures marketQuotesMeasures)
 {
     return(new SyntheticRatesCurveCalibrator(calibrator, marketQuotesMeasures));
 }