Class NormalIborFutureOptionExpirySimpleMoneynessVolatilities
- java.lang.Object
-
- com.opengamma.strata.pricer.index.NormalIborFutureOptionExpirySimpleMoneynessVolatilities
-
- All Implemented Interfaces:
MarketDataView,ParameterizedData,IborFutureOptionVolatilities,NormalIborFutureOptionVolatilities,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class NormalIborFutureOptionExpirySimpleMoneynessVolatilities extends Object implements NormalIborFutureOptionVolatilities, org.joda.beans.ImmutableBean, Serializable
Data provider of volatility for Ibor future options in the normal or Bachelier model.The volatility is represented by a surface on the expiry and simple moneyness. The expiry is measured in number of days (not time) according to a day-count convention. The simple moneyness can be on the price or on the rate (1-price).
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNormalIborFutureOptionExpirySimpleMoneynessVolatilities.BuilderThe bean-builder forNormalIborFutureOptionExpirySimpleMoneynessVolatilities.static classNormalIborFutureOptionExpirySimpleMoneynessVolatilities.MetaThe meta-bean forNormalIborFutureOptionExpirySimpleMoneynessVolatilities.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NormalIborFutureOptionExpirySimpleMoneynessVolatilities.Builderbuilder()Returns a builder used to create an instance of the bean.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 index of the underlying future.IborFutureOptionVolatilitiesNamegetName()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 normal volatility surface.ZonedDateTimegetValuationDateTime()Gets the valuation date-time.inthashCode()static NormalIborFutureOptionExpirySimpleMoneynessVolatilities.Metameta()The meta-bean forNormalIborFutureOptionExpirySimpleMoneynessVolatilities.NormalIborFutureOptionExpirySimpleMoneynessVolatilities.MetametaBean()static NormalIborFutureOptionExpirySimpleMoneynessVolatilitiesof(IborIndex index, ZonedDateTime valuationDateTime, Surface surface)Obtains an instance from the volatility surface and the date-time for which it is valid.CurrencyParameterSensitivitiesparameterSensitivity(PointSensitivities pointSensitivities)Calculates the parameter sensitivity.doublerelativeTime(ZonedDateTime zonedDateTime)Converts a time and date to a relative year fraction.NormalIborFutureOptionExpirySimpleMoneynessVolatilities.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()doublevolatility(double expiry, LocalDate fixingDate, double strikePrice, double futurePrice)Calculates the volatility at the specified expiry.NormalIborFutureOptionExpirySimpleMoneynessVolatilitieswithParameter(int parameterIndex, double newValue)Returns a copy of the data with the value at the specified index altered.NormalIborFutureOptionExpirySimpleMoneynessVolatilitieswithPerturbation(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.index.IborFutureOptionVolatilities
getValuationDate, parameterSensitivity, volatility
-
Methods inherited from interface com.opengamma.strata.pricer.index.NormalIborFutureOptionVolatilities
getVolatilityType
-
-
-
-
Method Detail
-
of
public static NormalIborFutureOptionExpirySimpleMoneynessVolatilities of(IborIndex index, ZonedDateTime valuationDateTime, Surface surface)
Obtains an instance from the 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.SIMPLE_MONEYNESS - The z-value type must be
ValueType.NORMAL_VOLATILITY - The day count must be set in the additional information using
SurfaceInfoType.DAY_COUNT
Surfaces.normalVolatilityByExpirySimpleMoneyness(String, DayCount, MoneynessType).- Parameters:
index- the Ibor indexsurface- the implied volatility surfacevaluationDateTime- the valuation date-time- Returns:
- the volatilities
- The x-value type must be
-
getName
public IborFutureOptionVolatilitiesName getName()
Description copied from interface:IborFutureOptionVolatilitiesGets the name of these volatilities.- Specified by:
getNamein interfaceIborFutureOptionVolatilities- 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 NormalIborFutureOptionExpirySimpleMoneynessVolatilities 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 interfaceIborFutureOptionVolatilities- Specified by:
withParameterin interfaceNormalIborFutureOptionVolatilities- 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 NormalIborFutureOptionExpirySimpleMoneynessVolatilities 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 interfaceIborFutureOptionVolatilities- Specified by:
withPerturbationin interfaceNormalIborFutureOptionVolatilities- 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, LocalDate fixingDate, double strikePrice, double futurePrice)Description copied from interface:IborFutureOptionVolatilitiesCalculates the volatility at the specified expiry.This relies on expiry supplied by
IborFutureOptionVolatilities.relativeTime(ZonedDateTime).- Specified by:
volatilityin interfaceIborFutureOptionVolatilities- Parameters:
expiry- the time to expiry as a year fractionfixingDate- the underlying future fixing datestrikePrice- the option strike pricefuturePrice- the price of the underlying future- Returns:
- the volatility
-
parameterSensitivity
public CurrencyParameterSensitivities parameterSensitivity(PointSensitivities pointSensitivities)
Description copied from interface:IborFutureOptionVolatilitiesCalculates 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 interfaceIborFutureOptionVolatilities- Parameters:
pointSensitivities- the point sensitivities- Returns:
- the sensitivity to the underlying parameters
-
relativeTime
public double relativeTime(ZonedDateTime zonedDateTime)
Description copied from interface:IborFutureOptionVolatilitiesConverts 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 interfaceIborFutureOptionVolatilities- Parameters:
zonedDateTime- the date-time to find the relative year fraction of- Returns:
- the relative year fraction
-
meta
public static NormalIborFutureOptionExpirySimpleMoneynessVolatilities.Meta meta()
The meta-bean forNormalIborFutureOptionExpirySimpleMoneynessVolatilities.- Returns:
- the meta-bean, not null
-
builder
public static NormalIborFutureOptionExpirySimpleMoneynessVolatilities.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public NormalIborFutureOptionExpirySimpleMoneynessVolatilities.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getIndex
public IborIndex getIndex()
Gets the index of the underlying future.- Specified by:
getIndexin interfaceIborFutureOptionVolatilities- 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 interfaceIborFutureOptionVolatilities- Returns:
- the value of the property, not null
-
getSurface
public Surface getSurface()
Gets the normal volatility surface.The x-value of the surface is the expiry, as a year fraction. The y-value of the surface is the simple moneyness.
- Returns:
- the value of the property, not null
-
toBuilder
public NormalIborFutureOptionExpirySimpleMoneynessVolatilities.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-