Class RatesCurveCalibrator
- java.lang.Object
-
- com.opengamma.strata.pricer.curve.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 Summary
All Methods Static Methods Instance Methods Concrete 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(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.String
toString()
-
-
-
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
andCalibrationMeasures.PRESENT_VALUE
measures are used.- Parameters:
toleranceAbs
- the absolute tolerancetoleranceRel
- the relative tolerancestepMaximum
- 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 tolerancetoleranceRel
- the relative tolerancestepMaximum
- the maximum stepsmeasures
- 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 tolerancetoleranceRel
- the relative tolerancestepMaximum
- the maximum stepsmeasures
- the calibration measures, used to compute the function for which the root is foundpvMeasures
- 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 usemeasures
- the calibration measures, used to compute the function for which the root is foundpvMeasures
- 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 definitionmarketData
- the market data required to build a trade for the instrument, including time-seriesrefData
- 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 definitionsknownData
- the starting data for the calibrationmarketData
- the market data required to build a trade for the instrumentrefData
- the reference data, used to resolve the trades- Returns:
- the rates provider resulting from the calibration
-
-