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
PenaltyMatrixGenerator
for detail.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DirectIborCapletFloorletVolatilityDefinition.Builder
The bean-builder forDirectIborCapletFloorletVolatilityDefinition
.static class
DirectIborCapletFloorletVolatilityDefinition.Meta
The meta-bean forDirectIborCapletFloorletVolatilityDefinition
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DirectIborCapletFloorletVolatilityDefinition.Builder
builder()
Returns a builder used to create an instance of the bean.DoubleMatrix
computePenaltyMatrix(DoubleArray strikes, DoubleArray expiries)
Computes penalty matrix.SurfaceMetadata
createMetadata(RawOptionData capFloorData)
Creates surface metadata.boolean
equals(Object obj)
DayCount
getDayCount()
Gets the day count to measure the time in the expiry dimension.IborIndex
getIndex()
Gets the Ibor index for which the data is valid.GridSurfaceInterpolator
getInterpolator()
Gets the interpolator for the caplet volatilities.double
getLambdaExpiry()
Gets penalty intensity parameter for expiry dimension.double
getLambdaStrike()
Gets penalty intensity parameter for strike dimension.IborCapletFloorletVolatilitiesName
getName()
Gets the name of the volatilities.Optional<Curve>
getShiftCurve()
Gets the shift parameter of shifted Black model.int
hashCode()
static DirectIborCapletFloorletVolatilityDefinition.Meta
meta()
The meta-bean forDirectIborCapletFloorletVolatilityDefinition
.DirectIborCapletFloorletVolatilityDefinition.Meta
metaBean()
static DirectIborCapletFloorletVolatilityDefinition
of(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double lambdaExpiry, double lambdaStrike, GridSurfaceInterpolator interpolator)
Obtains an instance with zero shift.static DirectIborCapletFloorletVolatilityDefinition
of(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double lambdaExpiry, double lambdaStrike, GridSurfaceInterpolator interpolator, Curve shiftCurve)
Obtains an instance with shift curve.DirectIborCapletFloorletVolatilityDefinition.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
-
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:IborCapletFloorletVolatilityDefinition
Creates surface metadata.- Specified by:
createMetadata
in 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:
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
-
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
-
-