Class DirectIborCapletFloorletFlatVolatilityDefinition
- java.lang.Object
-
- com.opengamma.strata.pricer.capfloor.DirectIborCapletFloorletFlatVolatilityDefinition
-
- All Implemented Interfaces:
IborCapletFloorletVolatilityDefinition
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class DirectIborCapletFloorletFlatVolatilityDefinition extends Object implements IborCapletFloorletVolatilityDefinition, org.joda.beans.ImmutableBean, Serializable
Definition of caplet volatilities calibration.This definition is used with
DirectIborCapletFloorletFlatVolatilityCalibrator
. 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 on the expiry dimension interpolated byCurveInterpolator
.The penalty defined in this class is based on the finite difference approximation of the second order derivatives along time dimension. See
PenaltyMatrixGenerator
for detail.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DirectIborCapletFloorletFlatVolatilityDefinition.Builder
The bean-builder forDirectIborCapletFloorletFlatVolatilityDefinition
.static class
DirectIborCapletFloorletFlatVolatilityDefinition.Meta
The meta-bean forDirectIborCapletFloorletFlatVolatilityDefinition
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DirectIborCapletFloorletFlatVolatilityDefinition.Builder
builder()
Returns a builder used to create an instance of the bean.DoubleMatrix
computePenaltyMatrix(DoubleArray expiries)
Computes penalty matrix.CurveMetadata
createCurveMetadata(RawOptionData capFloorData)
Creates curve metadata.SurfaceMetadata
createMetadata(RawOptionData capFloorData)
Creates surface metadata.boolean
equals(Object obj)
DayCount
getDayCount()
Gets the day count to measure the time.CurveExtrapolator
getExtrapolatorLeft()
Gets the extrapolator for the caplet volatilities on the left.CurveExtrapolator
getExtrapolatorRight()
Gets the extrapolator for the caplet volatilities on the right.IborIndex
getIndex()
Gets the Ibor index for which the data is valid.CurveInterpolator
getInterpolator()
Gets the interpolator for the caplet volatilities.double
getLambda()
Gets penalty intensity parameter.IborCapletFloorletVolatilitiesName
getName()
Gets the name of the volatilities.int
hashCode()
static DirectIborCapletFloorletFlatVolatilityDefinition.Meta
meta()
The meta-bean forDirectIborCapletFloorletFlatVolatilityDefinition
.DirectIborCapletFloorletFlatVolatilityDefinition.Meta
metaBean()
static DirectIborCapletFloorletFlatVolatilityDefinition
of(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double lambda, CurveInterpolator interpolator)
Obtains an instance with flat extrapolators.static DirectIborCapletFloorletFlatVolatilityDefinition
of(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double lambda, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight)
Obtains an instance.DirectIborCapletFloorletFlatVolatilityDefinition.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 DirectIborCapletFloorletFlatVolatilityDefinition of(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double lambda, CurveInterpolator interpolator)
Obtains an instance with flat extrapolators.- Parameters:
name
- the name of the volatilitiesindex
- the Ibor indexdayCount
- the day count to uselambda
- the penalty intensity parameterinterpolator
- the interpolator- Returns:
- the instance
-
of
public static DirectIborCapletFloorletFlatVolatilityDefinition of(IborCapletFloorletVolatilitiesName name, IborIndex index, DayCount dayCount, double lambda, CurveInterpolator interpolator, CurveExtrapolator extrapolatorLeft, CurveExtrapolator extrapolatorRight)
Obtains an instance.- Parameters:
name
- the name of the volatilitiesindex
- the Ibor indexdayCount
- the day count to uselambda
- the penalty intensity parameterinterpolator
- the surface interpolatorextrapolatorLeft
- the extrapolator leftextrapolatorRight
- the extrapolator right- 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
-
createCurveMetadata
public CurveMetadata createCurveMetadata(RawOptionData capFloorData)
Creates curve metadata.- Parameters:
capFloorData
- the data- Returns:
- the curve metadata
-
computePenaltyMatrix
public DoubleMatrix computePenaltyMatrix(DoubleArray expiries)
Computes penalty matrix.The penalty matrix is based on the second order finite difference differentiation in
PenaltyMatrixGenerator
. The number of node points must be greater than 2 in order to compute the second order derivative.- Parameters:
expiries
- the expiries- Returns:
- the penalty matrix
-
meta
public static DirectIborCapletFloorletFlatVolatilityDefinition.Meta meta()
The meta-bean forDirectIborCapletFloorletFlatVolatilityDefinition
.- Returns:
- the meta-bean, not null
-
builder
public static DirectIborCapletFloorletFlatVolatilityDefinition.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public DirectIborCapletFloorletFlatVolatilityDefinition.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.- Specified by:
getDayCount
in interfaceIborCapletFloorletVolatilityDefinition
- Returns:
- the value of the property, not null
-
getLambda
public double getLambda()
Gets penalty intensity parameter.- Returns:
- the value of the property
-
getInterpolator
public CurveInterpolator getInterpolator()
Gets the interpolator for the caplet volatilities.- Returns:
- the value of the property, not null
-
getExtrapolatorLeft
public CurveExtrapolator getExtrapolatorLeft()
Gets the extrapolator for the caplet volatilities on the left.- Returns:
- the value of the property, not null
-
getExtrapolatorRight
public CurveExtrapolator getExtrapolatorRight()
Gets the extrapolator for the caplet volatilities on the right.- Returns:
- the value of the property, not null
-
toBuilder
public DirectIborCapletFloorletFlatVolatilityDefinition.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-