Class RatesCurveCalibrator


  • public final class RatesCurveCalibrator
    extends Object
    Curve calibrator for rates curves.

    This calibrator takes an abstract curve definition and produces real curves.

    Curves are calibrated in groups or one or more curves. In addition, more than one group may be calibrated together.

    Each curve is defined using two or more nodes. Each node primarily defines enough information to produce a reference trade. Calibration involves pricing, and re-pricing, these trades to find the best fit using a root finder.

    Once calibrated, the curves are then available for use. Each node in the curve definition becomes a parameter in the matching output curve.

    • Method Detail

      • standard

        public static RatesCurveCalibrator standard()
        The standard curve calibrator.

        This uses the standard tolerance of 1e-9, a maximum of 1000 steps. The default CalibrationMeasures.PAR_SPREAD measures are used.

        Returns:
        the standard curve calibrator
      • of

        public static RatesCurveCalibrator of​(double toleranceAbs,
                                              double toleranceRel,
                                              int stepMaximum)
        Obtains an instance specifying tolerances to use.

        This uses a Broyden root finder. The standard CalibrationMeasures.PAR_SPREAD and CalibrationMeasures.PRESENT_VALUE measures are used.

        Parameters:
        toleranceAbs - the absolute tolerance
        toleranceRel - the relative tolerance
        stepMaximum - the maximum steps
        Returns:
        the curve calibrator
      • of

        public static RatesCurveCalibrator of​(double toleranceAbs,
                                              double toleranceRel,
                                              int stepMaximum,
                                              CalibrationMeasures measures)
        Obtains an instance specifying tolerances and measures to use.

        This uses a Broyden root finder. The standard CalibrationMeasures.PRESENT_VALUE measures are used.

        Parameters:
        toleranceAbs - the absolute tolerance
        toleranceRel - the relative tolerance
        stepMaximum - the maximum steps
        measures - the calibration measures, used to compute the function for which the root is found
        Returns:
        the curve calibrator
      • of

        public static RatesCurveCalibrator of​(double toleranceAbs,
                                              double toleranceRel,
                                              int stepMaximum,
                                              CalibrationMeasures measures,
                                              CalibrationMeasures pvMeasures)
        Obtains an instance specifying tolerances and measures to use.

        This uses a Broyden root finder.

        Parameters:
        toleranceAbs - the absolute tolerance
        toleranceRel - the relative tolerance
        stepMaximum - the maximum steps
        measures - the calibration measures, used to compute the function for which the root is found
        pvMeasures - the present value measures, used to compute the present value sensitivity to market quotes stored in the metadata
        Returns:
        the curve calibrator
      • of

        public static RatesCurveCalibrator of​(NewtonVectorRootFinder rootFinder,
                                              CalibrationMeasures measures,
                                              CalibrationMeasures pvMeasures)
        Obtains an instance specifying the measures to use.
        Parameters:
        rootFinder - the root finder to use
        measures - the calibration measures, used to compute the function for which the root is found
        pvMeasures - the present value measures, used to compute the present value sensitivity to market quotes stored in the metadata
        Returns:
        the curve calibrator
      • getMeasures

        public CalibrationMeasures getMeasures()
        Gets the measures.
        Returns:
        the measures
      • calibrate

        public ImmutableRatesProvider calibrate​(RatesCurveGroupDefinition curveGroupDefn,
                                                MarketData marketData,
                                                ReferenceData refData)
        Calibrates a single curve group, containing one or more curves.

        The calibration is defined using RatesCurveGroupDefinition. Observable market data, time-series and FX are also needed to complete the calibration. The valuation date is defined by the market data.

        The Jacobian matrices are computed and stored in curve metadata.

        Parameters:
        curveGroupDefn - the curve group definition
        marketData - the market data required to build a trade for the instrument, including time-series
        refData - the reference data, used to resolve the trades
        Returns:
        the rates provider resulting from the calibration
      • calibrate

        public ImmutableRatesProvider calibrate​(List<RatesCurveGroupDefinition> allGroupDefns,
                                                ImmutableRatesProvider knownData,
                                                MarketData marketData,
                                                ReferenceData refData)
        Calibrates a list of curve groups, each containing one or more curves.

        The calibration is defined using a list of RatesCurveGroupDefinition. Observable market data and existing known data are also needed to complete the calibration.

        A curve must only exist in one group.

        Parameters:
        allGroupDefns - the curve group definitions
        knownData - the starting data for the calibration
        marketData - the market data required to build a trade for the instrument
        refData - the reference data, used to resolve the trades
        Returns:
        the rates provider resulting from the calibration