## Class RatesCurveCalibrator

• java.lang.Object
• com.opengamma.strata.pricer.curve.RatesCurveCalibrator

• public final class RatesCurveCalibrator
extends java.lang.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 Summary

All Methods
Modifier and Type Method Description
ImmutableRatesProvider calibrate​(RatesCurveGroupDefinition curveGroupDefn, MarketData marketData, ReferenceData refData)
Calibrates a single curve group, containing one or more curves.
ImmutableRatesProvider calibrate​(java.util.List<RatesCurveGroupDefinition> allGroupDefns, ImmutableRatesProvider knownData, MarketData marketData, ReferenceData refData)
Calibrates a list of curve groups, each containing one or more curves.
CalibrationMeasures getMeasures()
Gets the measures.
static RatesCurveCalibrator of​(double toleranceAbs, double toleranceRel, int stepMaximum)
Obtains an instance specifying tolerances to use.
static RatesCurveCalibrator of​(double toleranceAbs, double toleranceRel, int stepMaximum, CalibrationMeasures measures)
Obtains an instance specifying tolerances and measures to use.
static RatesCurveCalibrator of​(double toleranceAbs, double toleranceRel, int stepMaximum, CalibrationMeasures measures, CalibrationMeasures pvMeasures)
Obtains an instance specifying tolerances and measures to use.
static RatesCurveCalibrator of​(NewtonVectorRootFinder rootFinder, CalibrationMeasures measures, CalibrationMeasures pvMeasures)
Obtains an instance specifying the measures to use.
static RatesCurveCalibrator standard()
The standard curve calibrator.
java.lang.String toString()
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### 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​(java.util.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
• #### toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object