Class DirectIborCapletFloorletVolatilityDefinition
- java.lang.Object
-
- com.opengamma.strata.pricer.capfloor.DirectIborCapletFloorletVolatilityDefinition
-
- All Implemented Interfaces:
IborCapletFloorletVolatilityDefinition,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class DirectIborCapletFloorletVolatilityDefinition extends Object implements IborCapletFloorletVolatilityDefinition, org.joda.beans.ImmutableBean, Serializable
Definition of caplet volatilities calibration.This definition is used with
DirectIborCapletFloorletVolatilityCalibrator. The volatilities of the constituent caplets in the market caps are "model parameters" and calibrated to the market data under a certain penalty constraint. The resulting volatilities object will be a set of caplet volatilities interpolated byGridSurfaceInterpolator.The penalty defined in this class is based on the finite difference approximation of the second order derivatives along time and strike directions. See
PenaltyMatrixGeneratorfor detail.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDirectIborCapletFloorletVolatilityDefinition.BuilderThe bean-builder forDirectIborCapletFloorletVolatilityDefinition.static classDirectIborCapletFloorletVolatilityDefinition.MetaThe meta-bean forDirectIborCapletFloorletVolatilityDefinition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DirectIborCapletFloorletVolatilityDefinition.Builderbuilder()Returns a builder used to create an instance of the bean.DoubleMatrixcomputePenaltyMatrix(DoubleArray strikes, DoubleArray expiries)Computes penalty matrix.SurfaceMetadatacreateMetadata(RawOptionData capFloorData)Creates surface metadata.booleanequals(Object obj)DayCountgetDayCount()Gets the day count to measure the time in the expiry dimension.IborIndexgetIndex()Gets the Ibor index for which the data is valid.GridSurfaceInterpolatorgetInterpolator()Gets the interpolator for the caplet volatilities.doublegetLambdaExpiry()Gets penalty intensity parameter for expiry dimension.doublegetLambdaStrike()Gets penalty intensity parameter for strike dimension.IborCapletFloorletVolatilitiesNamegetName()Gets the name of the volatilities.Optional<Curve>getShiftCurve()Gets the shift parameter of shifted Black model.inthashCode()static DirectIborCapletFloorletVolatilityDefinition.Metameta()The meta-bean forDirectIborCapletFloorletVolatilityDefinition.DirectIborCapletFloorletVolatilityDefinition.MetametaBean()static DirectIborCapletFloorletVolatilityDefinitionof(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double lambdaExpiry, double lambdaStrike, GridSurfaceInterpolator interpolator)Obtains an instance with zero shift.static DirectIborCapletFloorletVolatilityDefinitionof(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double lambdaExpiry, double lambdaStrike, GridSurfaceInterpolator interpolator, Curve shiftCurve)Obtains an instance with shift curve.DirectIborCapletFloorletVolatilityDefinition.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()-
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
-
of
public static DirectIborCapletFloorletVolatilityDefinition of(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double lambdaExpiry, double lambdaStrike, GridSurfaceInterpolator interpolator)
Obtains an instance with zero shift.- Parameters:
name- the name of the volatilitiesindex- the Ibor indexdayCount- the day count to uselambdaExpiry- the penalty intensity parameter for time dimensionlambdaStrike- the penalty intensity parameter for strike dimensioninterpolator- the surface interpolator- Returns:
- the instance
-
of
public static DirectIborCapletFloorletVolatilityDefinition of(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double lambdaExpiry, double lambdaStrike, GridSurfaceInterpolator interpolator, Curve shiftCurve)
Obtains an instance with shift curve.- Parameters:
name- the name of the volatilitiesindex- the Ibor indexdayCount- the day count to uselambdaExpiry- the penalty intensity parameter for time dimensionlambdaStrike- the penalty intensity parameter for strike dimensioninterpolator- the surface interpolatorshiftCurve- the shift surface- Returns:
- the instance
-
createMetadata
public SurfaceMetadata createMetadata(RawOptionData capFloorData)
Description copied from interface:IborCapletFloorletVolatilityDefinitionCreates surface metadata.- Specified by:
createMetadatain interfaceIborCapletFloorletVolatilityDefinition- Parameters:
capFloorData- the cap/floor data- Returns:
- the surface metadata
-
computePenaltyMatrix
public DoubleMatrix computePenaltyMatrix(DoubleArray strikes, DoubleArray expiries)
Computes penalty matrix.The penalty matrix is based on the second order finite difference differentiation in
PenaltyMatrixGenerator. The number of node points in each direction must be greater than 2 in order to compute the second order derivative.- Parameters:
strikes- the strikesexpiries- the expiries- Returns:
- the penalty matrix
-
meta
public static DirectIborCapletFloorletVolatilityDefinition.Meta meta()
The meta-bean forDirectIborCapletFloorletVolatilityDefinition.- Returns:
- the meta-bean, not null
-
builder
public static DirectIborCapletFloorletVolatilityDefinition.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public DirectIborCapletFloorletVolatilityDefinition.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getName
public IborCapletFloorletVolatilitiesName getName()
Gets the name of the volatilities.- Specified by:
getNamein 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:
getIndexin 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:
getDayCountin interfaceIborCapletFloorletVolatilityDefinition- Returns:
- the value of the property, not null
-
getLambdaExpiry
public double getLambdaExpiry()
Gets penalty intensity parameter for expiry dimension.- Returns:
- the value of the property
-
getLambdaStrike
public double getLambdaStrike()
Gets penalty intensity parameter for strike dimension.- Returns:
- the value of the property
-
getInterpolator
public GridSurfaceInterpolator getInterpolator()
Gets the interpolator for the caplet volatilities.- Returns:
- the value of the property, not null
-
getShiftCurve
public Optional<Curve> getShiftCurve()
Gets the shift parameter of shifted Black model.The x value of the curve is the expiry. The market volatilities are calibrated to shifted Black model if this field is not null.
- Returns:
- the optional value of the property, not null
-
toBuilder
public DirectIborCapletFloorletVolatilityDefinition.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-