Class DirectIborCapletFloorletFlatVolatilityCalibrator
- java.lang.Object
-
- com.opengamma.strata.pricer.capfloor.DirectIborCapletFloorletFlatVolatilityCalibrator
-
public class DirectIborCapletFloorletFlatVolatilityCalibrator extends Object
Caplet volatilities calibration to cap volatilities.The volatilities of the constituent caplets in the market caps are "model parameters" and calibrated to the market data under the penalty constraint. The penalty is based on the second-order finite difference differentiation along the expiry dimension.
The resultant volatility type is the same as the input volatility type. e.g., Black caplet volatilities
BlackIborCapletFloorletExpiryFlatVolatilities
are returned if Black cap volatilities are plugged in, and normal caplet volatilitiesNormalIborCapletFloorletExpiryFlatVolatilities
are returned otherwise.The calibration is conducted once the cap volatilities are converted to cap prices. Thus the error values in
RawOptionData
are applied in the price space rather than the volatility space.
-
-
Method Summary
-
-
-
Method Detail
-
standard
public static DirectIborCapletFloorletFlatVolatilityCalibrator standard()
Obtains the standard instance.- Returns:
- the instance
-
of
public static DirectIborCapletFloorletFlatVolatilityCalibrator of(VolatilityIborCapFloorLegPricer pricer, double epsilon, ReferenceData referenceData)
Obtains an instance.The epsilon is the parameter used in
NonLinearLeastSquareWithPenalty
, where the iteration stops when certain quantities are smaller than this parameter.- Parameters:
pricer
- the cap pricerepsilon
- the epsilon parameterreferenceData
- the reference data- Returns:
- the instance
-
calibrate
public IborCapletFloorletVolatilityCalibrationResult calibrate(IborCapletFloorletVolatilityDefinition definition, ZonedDateTime calibrationDateTime, RawOptionData capFloorData, RatesProvider ratesProvider)
Calibrates caplet volatilities to cap volatilities.- Parameters:
definition
- the caplet volatility definitioncalibrationDateTime
- the calibration timecapFloorData
- the cap dataratesProvider
- the rates provider- Returns:
- the calibration result
-
getReferenceData
protected ReferenceData getReferenceData()
Gets the reference data.- Returns:
- the reference data
-
getLegPricer
protected VolatilityIborCapFloorLegPricer getLegPricer()
Gets the leg pricer.- Returns:
- the leg pricer
-
reduceRawData
protected void reduceRawData(IborCapletFloorletVolatilityDefinition definition, RatesProvider ratesProvider, DoubleArray strikes, DoubleArray volatilityData, DoubleArray errors, LocalDate startDate, LocalDate endDate, SurfaceMetadata metadata, Function<Surface,IborCapletFloorletVolatilities> volatilityFunction, List<Double> timeList, List<Double> strikeList, List<Double> volList, List<ResolvedIborCapFloorLeg> capList, List<Double> priceList, List<Double> errorList)
-
volatilitiesFunction
protected Function<Surface,IborCapletFloorletVolatilities> volatilitiesFunction(IborCapletFloorletVolatilityDefinition definition, ZonedDateTime calibrationDateTime, RawOptionData capFloorData)
-
-