Class SabrIborCapletFloorletVolatilityCalibrator
- java.lang.Object
-
- com.opengamma.strata.pricer.capfloor.SabrIborCapletFloorletVolatilityCalibrator
-
public class SabrIborCapletFloorletVolatilityCalibrator extends Object
Caplet volatilities calibration to cap volatilities based on SABR model.The SABR parameters are represented by
NodalCurve
. The node positions on the individual curves are flexible and defined inSabrIborCapletFloorletVolatilityCalibrationDefinition
. The resulting volatilities object will beSabrParametersIborCapletFloorletVolatilities
.The calibration to SABR is computed once the option volatility date is converted to prices. Thus the error values in
RawOptionData
are applied in the price space rather than the volatility space.
-
-
Field Summary
Fields Modifier and Type Field Description static SabrIborCapletFloorletVolatilityCalibrator
DEFAULT
Default implementation.
-
Method Summary
-
-
-
Field Detail
-
DEFAULT
public static final SabrIborCapletFloorletVolatilityCalibrator DEFAULT
Default implementation.
-
-
Method Detail
-
of
public static SabrIborCapletFloorletVolatilityCalibrator of(VolatilityIborCapFloorLegPricer pricer, SabrIborCapFloorLegPricer sabrPricer, double epsilon, ReferenceData referenceData)
Creates an instance.The epsilon is the parameter used in
NonLinearLeastSquare
, where the iteration stops when certain quantities are smaller than this parameter.- Parameters:
pricer
- the cap pricersabrPricer
- the SABR 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)
-
-