Class SabrIborCapletFloorletVolatilityCalibrationDefinition
- java.lang.Object
-
- com.opengamma.strata.pricer.capfloor.SabrIborCapletFloorletVolatilityCalibrationDefinition
-
- All Implemented Interfaces:
IborCapletFloorletVolatilityDefinition
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class SabrIborCapletFloorletVolatilityCalibrationDefinition extends Object implements IborCapletFloorletVolatilityDefinition, org.joda.beans.ImmutableBean, Serializable
Definition of caplet volatilities calibration.This definition is used with
SabrIborCapletFloorletVolatilityCalibrator
. The term structure of SABR model parameters is calibrated to cap volatilities. The SABR parameters are represented byNodalCurve
and the node positions on the curves are flexible.Either rho or beta must be fixed. Then the calibration is computed in terms of the other three SABR parameter curves. The resulting volatilities object will be
SabrParametersIborCapletFloorletVolatilities
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SabrIborCapletFloorletVolatilityCalibrationDefinition.Builder
The bean-builder forSabrIborCapletFloorletVolatilityCalibrationDefinition
.static class
SabrIborCapletFloorletVolatilityCalibrationDefinition.Meta
The meta-bean forSabrIborCapletFloorletVolatilityCalibrationDefinition
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SabrIborCapletFloorletVolatilityCalibrationDefinition.Builder
builder()
Returns a builder used to create an instance of the bean.DoubleArray
createFullInitialValues()
Create initial values for all the curve parameters.ParameterLimitsTransform[]
createFullTransform(ParameterLimitsTransform[] transform)
Creates the transformation definition for all the curve parameters.SurfaceMetadata
createMetadata(RawOptionData capFloorData)
Creates surface metadata.List<Curve>
createSabrParameterCurve(List<CurveMetadata> metadata, DoubleArray nodeValues)
Creates the parameter curves with parameter node values.ImmutableList<CurveMetadata>
createSabrParameterMetadata()
Creates curve metadata for SABR parameters.boolean
equals(Object obj)
Optional<Curve>
getBetaCurve()
Gets the beta (elasticity) curve.DayCount
getDayCount()
Gets the day count to measure the time in the expiry dimension.CurveExtrapolator
getExtrapolatorLeft()
Gets the left extrapolator for the SABR parameters.CurveExtrapolator
getExtrapolatorRight()
Gets the right extrapolator for the SABR parameters.IborIndex
getIndex()
Gets the Ibor index for which the data is valid.DoubleArray
getInitialParameters()
Gets the initial parameter values used in calibration.CurveInterpolator
getInterpolator()
Gets the interpolator for the SABR parameters.IborCapletFloorletVolatilitiesName
getName()
Gets the name of the volatilities.ImmutableList<DoubleArray>
getParameterCurveNodes()
Gets the nodes of SABR parameter curves.Optional<Curve>
getRhoCurve()
Gets the rho (correlation) curve.SabrVolatilityFormula
getSabrVolatilityFormula()
Gets the SABR formula.Curve
getShiftCurve()
Gets the shift curve.int
hashCode()
static SabrIborCapletFloorletVolatilityCalibrationDefinition.Meta
meta()
The meta-bean forSabrIborCapletFloorletVolatilityCalibrationDefinition
.SabrIborCapletFloorletVolatilityCalibrationDefinition.Meta
metaBean()
static SabrIborCapletFloorletVolatilityCalibrationDefinition
ofFixedBeta(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double beta, double shift, DoubleArray alphaCurveNodes, DoubleArray rhoCurveNodes, DoubleArray nuCurveNodes, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed beta and nonzero shift.static SabrIborCapletFloorletVolatilityCalibrationDefinition
ofFixedBeta(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double shift, DoubleArray alphaCurveNodes, DoubleArray rhoCurveNodes, DoubleArray nuCurveNodes, DoubleArray initialParameters, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed beta, nonzero shift and initial values.static SabrIborCapletFloorletVolatilityCalibrationDefinition
ofFixedBeta(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double beta, DoubleArray alphaCurveNodes, DoubleArray rhoCurveNodes, DoubleArray nuCurveNodes, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed beta and zero shift.static SabrIborCapletFloorletVolatilityCalibrationDefinition
ofFixedBeta(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, DoubleArray alphaCurveNodes, DoubleArray rhoCurveNodes, DoubleArray nuCurveNodes, DoubleArray initialParameters, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed beta, zero shift and initial values.static SabrIborCapletFloorletVolatilityCalibrationDefinition
ofFixedRho(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double rho, double shift, DoubleArray alphaCurveNodes, DoubleArray betaCurveNodes, DoubleArray nuCurveNodes, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed rho and nonzero shift.static SabrIborCapletFloorletVolatilityCalibrationDefinition
ofFixedRho(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double shift, DoubleArray alphaCurveNodes, DoubleArray betaCurveNodes, DoubleArray nuCurveNodes, DoubleArray initialParameters, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed rho, nonzero shift and initial values.static SabrIborCapletFloorletVolatilityCalibrationDefinition
ofFixedRho(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double rho, DoubleArray alphaCurveNodes, DoubleArray betaCurveNodes, DoubleArray nuCurveNodes, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed rho and zero shift.static SabrIborCapletFloorletVolatilityCalibrationDefinition
ofFixedRho(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, DoubleArray alphaCurveNodes, DoubleArray betaCurveNodes, DoubleArray nuCurveNodes, DoubleArray initialParameters, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed rho, zero shift and initial values.SabrIborCapletFloorletVolatilityCalibrationDefinition.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.pricer.capfloor.IborCapletFloorletVolatilityDefinition
createCap
-
-
-
-
Method Detail
-
ofFixedBeta
public static SabrIborCapletFloorletVolatilityCalibrationDefinition ofFixedBeta(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double beta, double shift, DoubleArray alphaCurveNodes, DoubleArray rhoCurveNodes, DoubleArray nuCurveNodes, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed beta and nonzero shift.The beta and shift are constant in time. The default initial values will be used in the calibration.
- Parameters:
name
- the name of volatilitiesindex
- the Ibor indexdayCount
- the day countbeta
- the betashift
- the shiftalphaCurveNodes
- the alpha curve nodesrhoCurveNodes
- the rho curve nodesnuCurveNodes
- the nu curve nodesinterpolator
- the interpolatorextrapolatorLeft
- the left extrapolatorextrapolatorRight
- the right extrapolatorsabrVolatilityFormula
- the SABR formula- Returns:
- the instance
-
ofFixedBeta
public static SabrIborCapletFloorletVolatilityCalibrationDefinition ofFixedBeta(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double beta, DoubleArray alphaCurveNodes, DoubleArray rhoCurveNodes, DoubleArray nuCurveNodes, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed beta and zero shift.The default initial values will be used in the calibration.
- Parameters:
name
- the name of volatilitiesindex
- the Ibor indexdayCount
- the day countbeta
- the betaalphaCurveNodes
- the alpha curve nodesrhoCurveNodes
- the rho curve nodesnuCurveNodes
- the nu curve nodesinterpolator
- the interpolatorextrapolatorLeft
- the left extrapolatorextrapolatorRight
- the right extrapolatorsabrVolatilityFormula
- the SABR formula- Returns:
- the instance
-
ofFixedBeta
public static SabrIborCapletFloorletVolatilityCalibrationDefinition ofFixedBeta(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double shift, DoubleArray alphaCurveNodes, DoubleArray rhoCurveNodes, DoubleArray nuCurveNodes, DoubleArray initialParameters, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed beta, nonzero shift and initial values.The beta and shift are constant in time.
- Parameters:
name
- the name of volatilitiesindex
- the Ibor indexdayCount
- the day countshift
- the shiftalphaCurveNodes
- the alpha curve nodesrhoCurveNodes
- the rho curve nodesnuCurveNodes
- the nu curve nodesinitialParameters
- the initial parametersinterpolator
- the interpolatorextrapolatorLeft
- the left extrapolatorextrapolatorRight
- the right extrapolatorsabrVolatilityFormula
- the SABR formula- Returns:
- the instance
-
ofFixedBeta
public static SabrIborCapletFloorletVolatilityCalibrationDefinition ofFixedBeta(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, DoubleArray alphaCurveNodes, DoubleArray rhoCurveNodes, DoubleArray nuCurveNodes, DoubleArray initialParameters, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed beta, zero shift and initial values.The beta and shift are constant in time.
- Parameters:
name
- the name of volatilitiesindex
- the Ibor indexdayCount
- the day countalphaCurveNodes
- the alpha curve nodesrhoCurveNodes
- the rho curve nodesnuCurveNodes
- the nu curve nodesinitialParameters
- the initial parametersinterpolator
- the interpolatorextrapolatorLeft
- the left extrapolatorextrapolatorRight
- the right extrapolatorsabrVolatilityFormula
- the SABR formula- Returns:
- the instance
-
ofFixedRho
public static SabrIborCapletFloorletVolatilityCalibrationDefinition ofFixedRho(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double rho, double shift, DoubleArray alphaCurveNodes, DoubleArray betaCurveNodes, DoubleArray nuCurveNodes, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed rho and nonzero shift.The rho and shift are constant in time. The default initial values will be used in the calibration.
- Parameters:
name
- the name of volatilitiesindex
- the Ibor indexdayCount
- the day countrho
- the rhoshift
- the shiftalphaCurveNodes
- the alpha curve nodesbetaCurveNodes
- the beta curve nodesnuCurveNodes
- the nu curve nodesinterpolator
- the interpolatorextrapolatorLeft
- the left extrapolatorextrapolatorRight
- the right extrapolatorsabrVolatilityFormula
- the SABR formula- Returns:
- the instance
-
ofFixedRho
public static SabrIborCapletFloorletVolatilityCalibrationDefinition ofFixedRho(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double rho, DoubleArray alphaCurveNodes, DoubleArray betaCurveNodes, DoubleArray nuCurveNodes, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed rho and zero shift.The rho is constant in time. The default initial values will be used in the calibration.
- Parameters:
name
- the name of volatilitiesindex
- the Ibor indexdayCount
- the day countrho
- the rhoalphaCurveNodes
- the alpha curve nodesbetaCurveNodes
- the beta curve nodesnuCurveNodes
- the nu curve nodesinterpolator
- the interpolatorextrapolatorLeft
- the left extrapolatorextrapolatorRight
- the right extrapolatorsabrVolatilityFormula
- the SABR formula- Returns:
- the instance
-
ofFixedRho
public static SabrIborCapletFloorletVolatilityCalibrationDefinition ofFixedRho(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double shift, DoubleArray alphaCurveNodes, DoubleArray betaCurveNodes, DoubleArray nuCurveNodes, DoubleArray initialParameters, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed rho, nonzero shift and initial values.The rho and shift are constant in time.
- Parameters:
name
- the name of volatilitiesindex
- the Ibor indexdayCount
- the day countshift
- the shiftalphaCurveNodes
- the alpha curve nodesbetaCurveNodes
- the beta curve nodesnuCurveNodes
- the nu curve nodesinitialParameters
- the initial parametersinterpolator
- the interpolatorextrapolatorLeft
- the left extrapolatorextrapolatorRight
- the right extrapolatorsabrVolatilityFormula
- the SABR formula- Returns:
- the instance
-
ofFixedRho
public static SabrIborCapletFloorletVolatilityCalibrationDefinition ofFixedRho(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, DoubleArray alphaCurveNodes, DoubleArray betaCurveNodes, DoubleArray nuCurveNodes, DoubleArray initialParameters, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight, SabrVolatilityFormula sabrVolatilityFormula)
Obtains an instance with fixed rho, zero shift and initial values.The rho is constant in time.
- Parameters:
name
- the name of volatilitiesindex
- the Ibor indexdayCount
- the day countalphaCurveNodes
- the alpha curve nodesbetaCurveNodes
- the beta curve nodesnuCurveNodes
- the nu curve nodesinitialParameters
- the initial parametersinterpolator
- the interpolatorextrapolatorLeft
- the left extrapolatorextrapolatorRight
- the right extrapolatorsabrVolatilityFormula
- the SABR formula- Returns:
- the instance
-
createMetadata
public SurfaceMetadata createMetadata(RawOptionData capFloorData)
Description copied from interface:IborCapletFloorletVolatilityDefinition
Creates surface metadata.- Specified by:
createMetadata
in interfaceIborCapletFloorletVolatilityDefinition
- Parameters:
capFloorData
- the cap/floor data- Returns:
- the surface metadata
-
createSabrParameterMetadata
public ImmutableList<CurveMetadata> createSabrParameterMetadata()
Creates curve metadata for SABR parameters.The metadata in the list are ordered as alpha, beta, rho, then nu.
- Returns:
- the curve metadata
-
createSabrParameterCurve
public List<Curve> createSabrParameterCurve(List<CurveMetadata> metadata, DoubleArray nodeValues)
Creates the parameter curves with parameter node values.The node values must be combined nodes ordered as alpha, beta (if beta is not fixed), rho (if rho is not fixed), then nu.
The returned curves are ordered in the same way. If the beta is fixed,
betaCurve
is returned as the second element. If the rho is fixed,rhoCurve
is returned as the third element.- Parameters:
metadata
- the metadatanodeValues
- the parameter node values- Returns:
- the curves
-
createFullTransform
public ParameterLimitsTransform[] createFullTransform(ParameterLimitsTransform[] transform)
Creates the transformation definition for all the curve parameters.The elements in
transform
must be ordered as alpha, beta, rho, then nu.- Parameters:
transform
- the transform- Returns:
- the full transform
-
createFullInitialValues
public DoubleArray createFullInitialValues()
Create initial values for all the curve parameters.- Returns:
- the initial values
-
meta
public static SabrIborCapletFloorletVolatilityCalibrationDefinition.Meta meta()
The meta-bean forSabrIborCapletFloorletVolatilityCalibrationDefinition
.- Returns:
- the meta-bean, not null
-
builder
public static SabrIborCapletFloorletVolatilityCalibrationDefinition.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public SabrIborCapletFloorletVolatilityCalibrationDefinition.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getName
public IborCapletFloorletVolatilitiesName getName()
Gets the name of the volatilities.- Specified by:
getName
in interfaceIborCapletFloorletVolatilityDefinition
- Returns:
- the value of the property, not null
-
getIndex
public IborIndex getIndex()
Gets the Ibor index for which the data is valid.- Specified by:
getIndex
in interfaceIborCapletFloorletVolatilityDefinition
- Returns:
- the value of the property, not null
-
getDayCount
public DayCount getDayCount()
Gets the day count to measure the time in the expiry dimension.- Specified by:
getDayCount
in interfaceIborCapletFloorletVolatilityDefinition
- Returns:
- the value of the property, not null
-
getBetaCurve
public Optional<Curve> getBetaCurve()
Gets the beta (elasticity) curve.This represents the beta parameter of SABR model.
The beta will be treated as one of the calibration parameters if this field is not specified. Either
betaCurve
orrhoCurve
must be present.- Returns:
- the optional value of the property, not null
-
getRhoCurve
public Optional<Curve> getRhoCurve()
Gets the rho (correlation) curve.This represents the rho parameter of SABR model.
The rho will be treated as one of the calibration parameters if this field is not specified. Either
betaCurve
orrhoCurve
must be present.- Returns:
- the optional value of the property, not null
-
getShiftCurve
public Curve getShiftCurve()
Gets the shift curve.This represents the shift parameter of shifted SABR model.
The shift is set to be zero if this field is not specified.
- Returns:
- the value of the property, not null
-
getParameterCurveNodes
public ImmutableList<DoubleArray> getParameterCurveNodes()
Gets the nodes of SABR parameter curves.The size of the list must be 4, ordered as alpha, beta, rho and nu.
If the number of nodes is greater than 1, the curve will be created with
CurveInterpolator
andCurveExtrapolator
specified below. Otherwise,ConstantNodalCurve
will be created.- Returns:
- the value of the property, not null
-
getInitialParameters
public DoubleArray getInitialParameters()
Gets the initial parameter values used in calibration.Default values will be used if not specified. The size of this field must be 4, ordered as alpha, beta, rho and nu.
- Returns:
- the value of the property, not null
-
getInterpolator
public CurveInterpolator getInterpolator()
Gets the interpolator for the SABR parameters.- Returns:
- the value of the property, not null
-
getExtrapolatorLeft
public CurveExtrapolator getExtrapolatorLeft()
Gets the left extrapolator for the SABR parameters.The flat extrapolation is used if not specified.
- Returns:
- the value of the property, not null
-
getExtrapolatorRight
public CurveExtrapolator getExtrapolatorRight()
Gets the right extrapolator for the SABR parameters.The flat extrapolation is used if not specified.
- Returns:
- the value of the property, not null
-
getSabrVolatilityFormula
public SabrVolatilityFormula getSabrVolatilityFormula()
Gets the SABR formula.- Returns:
- the value of the property, not null
-
toBuilder
public SabrIborCapletFloorletVolatilityCalibrationDefinition.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-