Class BlackIborCapletFloorletExpiryStrikeVolatilities
- java.lang.Object
-
- com.opengamma.strata.pricer.capfloor.BlackIborCapletFloorletExpiryStrikeVolatilities
-
- All Implemented Interfaces:
MarketDataView,ParameterizedData,BlackIborCapletFloorletVolatilities,IborCapletFloorletVolatilities,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class BlackIborCapletFloorletExpiryStrikeVolatilities extends Object implements BlackIborCapletFloorletVolatilities, org.joda.beans.ImmutableBean, Serializable
Volatility for Ibor caplet/floorlet in the log-normal or Black model based on a surface.The volatility is represented by a surface on the expiry and strike dimensions.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBlackIborCapletFloorletExpiryStrikeVolatilities.MetaThe meta-bean forBlackIborCapletFloorletExpiryStrikeVolatilities.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)<T> Optional<T>findData(MarketDataName<T> name)Finds the market data with the specified name.OptionalIntfindParameterIndex(ParameterMetadata metadata)Finds the parameter index of the specified metadata.IborIndexgetIndex()Gets the Ibor index.IborCapletFloorletVolatilitiesNamegetName()Gets the name of these volatilities.doublegetParameter(int parameterIndex)Gets the value of the parameter at the specified index.intgetParameterCount()Gets the number of parameters.ParameterMetadatagetParameterMetadata(int parameterIndex)Gets the metadata of the parameter at the specified index.SurfacegetSurface()Gets the Black volatility surface.ZonedDateTimegetValuationDateTime()Gets the valuation date-time.inthashCode()static BlackIborCapletFloorletExpiryStrikeVolatilities.Metameta()The meta-bean forBlackIborCapletFloorletExpiryStrikeVolatilities.BlackIborCapletFloorletExpiryStrikeVolatilities.MetametaBean()static BlackIborCapletFloorletExpiryStrikeVolatilitiesof(IborIndex index, ZonedDateTime valuationDateTime, Surface surface)Obtains an instance from the implied volatility surface and the date-time for which it is valid.CurrencyParameterSensitivitiesparameterSensitivity(PointSensitivities pointSensitivities)Calculates the parameter sensitivity.doubleprice(double expiry, PutCall putCall, double strike, double forward, double volatility)Calculates the price.doublepriceDelta(double expiry, PutCall putCall, double strike, double forward, double volatility)Calculates the price delta.doublepriceGamma(double expiry, PutCall putCall, double strike, double forward, double volatility)Calculates the price gamma.doublepriceTheta(double expiry, PutCall putCall, double strike, double forward, double volatility)Calculates the price theta.doublepriceVega(double expiry, PutCall putCall, double strike, double forward, double volatility)Calculates the price vega.doublerelativeTime(ZonedDateTime dateTime)Converts a time and date to a relative year fraction.StringtoString()doublevolatility(double expiry, double strike, double forward)Calculates the volatility at the specified expiry.BlackIborCapletFloorletExpiryStrikeVolatilitieswithParameter(int parameterIndex, double newValue)Returns a copy of the data with the value at the specified index altered.BlackIborCapletFloorletExpiryStrikeVolatilitieswithPerturbation(ParameterPerturbation perturbation)Returns a perturbed copy of the data.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.pricer.capfloor.BlackIborCapletFloorletVolatilities
getVolatilityType
-
Methods inherited from interface com.opengamma.strata.pricer.capfloor.IborCapletFloorletVolatilities
getValuationDate, parameterSensitivity, volatility
-
-
-
-
Method Detail
-
of
public static BlackIborCapletFloorletExpiryStrikeVolatilities of(IborIndex index, ZonedDateTime valuationDateTime, Surface surface)
Obtains an instance from the implied volatility surface and the date-time for which it is valid.The surface is specified by an instance of
Surface, such asInterpolatedNodalSurface. The surface must contain the correct metadata:- The x-value type must be
ValueType.YEAR_FRACTION - The y-value type must be
ValueType.STRIKE - The z-value type must be
ValueType.BLACK_VOLATILITY - The day count must be set in the additional information using
SurfaceInfoType.DAY_COUNT
Surfaces.blackVolatilityByExpiryStrike(String, DayCount).- Parameters:
index- the Ibor index for which the data is validvaluationDateTime- the valuation date-timesurface- the implied volatility surface- Returns:
- the volatilities
- The x-value type must be
-
getName
public IborCapletFloorletVolatilitiesName getName()
Description copied from interface:IborCapletFloorletVolatilitiesGets the name of these volatilities.- Specified by:
getNamein interfaceIborCapletFloorletVolatilities- Returns:
- the name
-
findData
public <T> Optional<T> findData(MarketDataName<T> name)
Description copied from interface:MarketDataViewFinds the market data with the specified name.This is most commonly used to find an underlying curve or surface by name. If the market data cannot be found, empty is returned.
- Specified by:
findDatain interfaceMarketDataView- Type Parameters:
T- the type of the market data value- Parameters:
name- the name to find- Returns:
- the market data value, empty if not found
-
getParameterCount
public int getParameterCount()
Description copied from interface:ParameterizedDataGets the number of parameters.This returns the number of parameters, which can be used to create a loop to access the other methods on this interface.
- Specified by:
getParameterCountin interfaceParameterizedData- Returns:
- the number of parameters
-
getParameter
public double getParameter(int parameterIndex)
Description copied from interface:ParameterizedDataGets the value of the parameter at the specified index.- Specified by:
getParameterin interfaceParameterizedData- Parameters:
parameterIndex- the zero-based index of the parameter to get- Returns:
- the value of the parameter
-
getParameterMetadata
public ParameterMetadata getParameterMetadata(int parameterIndex)
Description copied from interface:ParameterizedDataGets the metadata of the parameter at the specified index.If there is no specific parameter metadata, an empty instance will be returned.
- Specified by:
getParameterMetadatain interfaceParameterizedData- Parameters:
parameterIndex- the zero-based index of the parameter to get- Returns:
- the metadata of the parameter
-
findParameterIndex
public OptionalInt findParameterIndex(ParameterMetadata metadata)
Description copied from interface:ParameterizedDataFinds the parameter index of the specified metadata.If the parameter metadata is not matched, an empty optional will be returned.
- Specified by:
findParameterIndexin interfaceParameterizedData- Parameters:
metadata- the parameter metadata to find the index of- Returns:
- the index of the parameter
-
withParameter
public BlackIborCapletFloorletExpiryStrikeVolatilities withParameter(int parameterIndex, double newValue)
Description copied from interface:ParameterizedDataReturns a copy of the data with the value at the specified index altered.This instance is immutable and unaffected by this method call.
- Specified by:
withParameterin interfaceBlackIborCapletFloorletVolatilities- Specified by:
withParameterin interfaceIborCapletFloorletVolatilities- Specified by:
withParameterin interfaceParameterizedData- Parameters:
parameterIndex- the zero-based index of the parameter to getnewValue- the new value for the specified parameter- Returns:
- a parameterized data instance based on this with the specified parameter altered
-
withPerturbation
public BlackIborCapletFloorletExpiryStrikeVolatilities withPerturbation(ParameterPerturbation perturbation)
Description copied from interface:ParameterizedDataReturns a perturbed copy of the data.The perturbation instance will be invoked once for each parameter in this instance, returning the perturbed value for that parameter. The result of this method is a new instance that is based on those perturbed values.
This instance is immutable and unaffected by this method call.
- Specified by:
withPerturbationin interfaceBlackIborCapletFloorletVolatilities- Specified by:
withPerturbationin interfaceIborCapletFloorletVolatilities- Specified by:
withPerturbationin interfaceParameterizedData- Parameters:
perturbation- the perturbation to apply- Returns:
- a parameterized data instance based on this with the specified perturbation applied
-
volatility
public double volatility(double expiry, double strike, double forward)Description copied from interface:IborCapletFloorletVolatilitiesCalculates the volatility at the specified expiry.This relies on expiry supplied by
IborCapletFloorletVolatilities.relativeTime(ZonedDateTime).- Specified by:
volatilityin interfaceIborCapletFloorletVolatilities- Parameters:
expiry- the time to expiry as a year fractionstrike- the option strike rateforward- the forward rate- Returns:
- the volatility
-
parameterSensitivity
public CurrencyParameterSensitivities parameterSensitivity(PointSensitivities pointSensitivities)
Description copied from interface:IborCapletFloorletVolatilitiesCalculates the parameter sensitivity.This computes the
CurrencyParameterSensitivitiesassociated with thePointSensitivities. This corresponds to the projection of the point sensitivity to the internal parameters representation.- Specified by:
parameterSensitivityin interfaceIborCapletFloorletVolatilities- Parameters:
pointSensitivities- the point sensitivities- Returns:
- the sensitivity to the underlying parameters
-
price
public double price(double expiry, PutCall putCall, double strike, double forward, double volatility)Description copied from interface:IborCapletFloorletVolatilitiesCalculates the price.This relies on expiry supplied by
IborCapletFloorletVolatilities.relativeTime(ZonedDateTime). This relies on volatility supplied byIborCapletFloorletVolatilities.volatility(double, double, double).- Specified by:
pricein interfaceIborCapletFloorletVolatilities- Parameters:
expiry- the time to expiry as a year fractionputCall- whether the option is put or callstrike- the option strike rateforward- the forward ratevolatility- the volatility- Returns:
- the price
-
priceDelta
public double priceDelta(double expiry, PutCall putCall, double strike, double forward, double volatility)Description copied from interface:IborCapletFloorletVolatilitiesCalculates the price delta.This is the first order sensitivity of the option price to the forward.
This relies on expiry supplied by
IborCapletFloorletVolatilities.relativeTime(ZonedDateTime). This relies on volatility supplied byIborCapletFloorletVolatilities.volatility(double, double, double).- Specified by:
priceDeltain interfaceIborCapletFloorletVolatilities- Parameters:
expiry- the time to expiry as a year fractionputCall- whether the option is put or callstrike- the option strike rateforward- the forward ratevolatility- the volatility- Returns:
- the delta
-
priceGamma
public double priceGamma(double expiry, PutCall putCall, double strike, double forward, double volatility)Description copied from interface:IborCapletFloorletVolatilitiesCalculates the price gamma.This is the second order sensitivity of the option price to the forward.
This relies on expiry supplied by
IborCapletFloorletVolatilities.relativeTime(ZonedDateTime). This relies on volatility supplied byIborCapletFloorletVolatilities.volatility(double, double, double).- Specified by:
priceGammain interfaceIborCapletFloorletVolatilities- Parameters:
expiry- the time to expiry as a year fractionputCall- whether the option is put or callstrike- the option strike rateforward- the forward ratevolatility- the volatility- Returns:
- the gamma
-
priceTheta
public double priceTheta(double expiry, PutCall putCall, double strike, double forward, double volatility)Description copied from interface:IborCapletFloorletVolatilitiesCalculates the price theta.This is the driftless sensitivity of the option price to a change in time to maturity.
This relies on expiry supplied by
IborCapletFloorletVolatilities.relativeTime(ZonedDateTime). This relies on volatility supplied byIborCapletFloorletVolatilities.volatility(double, double, double).- Specified by:
priceThetain interfaceIborCapletFloorletVolatilities- Parameters:
expiry- the time to expiry as a year fractionputCall- whether the option is put or callstrike- the option strike rateforward- the forward ratevolatility- the volatility- Returns:
- the theta
-
priceVega
public double priceVega(double expiry, PutCall putCall, double strike, double forward, double volatility)Description copied from interface:IborCapletFloorletVolatilitiesCalculates the price vega.This is the sensitivity of the option price to the implied volatility.
This relies on expiry supplied by
IborCapletFloorletVolatilities.relativeTime(ZonedDateTime). This relies on volatility supplied byIborCapletFloorletVolatilities.volatility(double, double, double).- Specified by:
priceVegain interfaceIborCapletFloorletVolatilities- Parameters:
expiry- the time to expiry as a year fractionputCall- whether the option is put or callstrike- the option strike rateforward- the forward ratevolatility- the volatility- Returns:
- the vega
-
relativeTime
public double relativeTime(ZonedDateTime dateTime)
Description copied from interface:IborCapletFloorletVolatilitiesConverts a time and date to a relative year fraction.When the date is after the valuation date (and potentially time), the returned number is negative.
- Specified by:
relativeTimein interfaceIborCapletFloorletVolatilities- Parameters:
dateTime- the date-time to find the relative year fraction of- Returns:
- the relative year fraction
-
meta
public static BlackIborCapletFloorletExpiryStrikeVolatilities.Meta meta()
The meta-bean forBlackIborCapletFloorletExpiryStrikeVolatilities.- Returns:
- the meta-bean, not null
-
metaBean
public BlackIborCapletFloorletExpiryStrikeVolatilities.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getIndex
public IborIndex getIndex()
Gets the Ibor index.The data must valid in terms of this Ibor index.
- Specified by:
getIndexin interfaceIborCapletFloorletVolatilities- Returns:
- the value of the property, not null
-
getValuationDateTime
public ZonedDateTime getValuationDateTime()
Gets the valuation date-time.The volatilities are calibrated for this date-time.
- Specified by:
getValuationDateTimein interfaceIborCapletFloorletVolatilities- Returns:
- the value of the property, not null
-
getSurface
public Surface getSurface()
Gets the Black volatility surface.The x-value of the surface is the expiry, as a year fraction. The y-value of the surface is the strike.
- Returns:
- the value of the property, not null
-
-