Class SmileDeltaParameters
- java.lang.Object
-
- com.opengamma.strata.pricer.fxopt.SmileDeltaParameters
-
- All Implemented Interfaces:
ParameterizedData,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class SmileDeltaParameters extends Object implements ParameterizedData, org.joda.beans.ImmutableBean, Serializable
A delta dependent smile as used in Forex market.This contains the data for delta dependent smile from at-the-money, risk reversal and strangle. The delta used is the delta with respect to forward.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSmileDeltaParameters.MetaThe meta-bean forSmileDeltaParameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)DoubleArraygetDelta()Gets the delta of the different data points.doublegetExpiry()Gets the time to expiry associated with the data.Optional<Tenor>getExpiryTenor()Gets the tenor associated with the time to expiry, optional.doublegetParameter(int parameterIndex)Gets the value of the parameter at the specified index.intgetParameterCount()Gets the number of parameters.ImmutableList<ParameterMetadata>getParameterMetadata()Gets the associated metadata.ParameterMetadatagetParameterMetadata(int parameterIndex)Gets the metadata of the parameter at the specified index.DoubleArraygetVolatility()Gets the volatilities associated with the strikes.inthashCode()DoubleArrayimpliedStrikesDerivativeToExpiry(double forward)Calculates the derivatives of the implied strikes to expiry.DoubleArrayimpliedStrikesDerivativeToSmileVols(double forward)Calculates the derivatives of the implied strikes to volatility.static SmileDeltaParameters.Metameta()The meta-bean forSmileDeltaParameters.SmileDeltaParameters.MetametaBean()static SmileDeltaParametersof(double expiry, double atmVolatility, DoubleArray delta, DoubleArray riskReversal, DoubleArray strangle)Obtains an instance from market data at-the-money, delta, risk-reversal and strangle.static SmileDeltaParametersof(double expiry, double atmVolatility, DoubleArray delta, DoubleArray riskReversal, DoubleArray strangle, List<ParameterMetadata> parameterMetadata)Obtains an instance from market data at-the-money, delta, risk-reversal and strangle.static SmileDeltaParametersof(double expiry, Tenor expiryTenor, double atmVolatility, DoubleArray delta, DoubleArray riskReversal, DoubleArray strangle)Obtains an instance from market data at-the-money, delta, risk-reversal and strangle.static SmileDeltaParametersof(double expiry, Tenor expiryTenor, DoubleArray delta, DoubleArray volatility)Obtains an instance from volatility.static SmileDeltaParametersof(double expiry, DoubleArray delta, DoubleArray volatility)Obtains an instance from volatility.static SmileDeltaParametersof(double expiry, DoubleArray delta, DoubleArray volatility, List<ParameterMetadata> parameterMetadata)Obtains an instance from volatility.DoubleArraystrike(double forward)Calculates the strikes in ascending order.StringtoString()SmileDeltaParameterswithParameter(int parameterIndex, double newValue)Returns a copy of the data with the value at the specified index altered.SmileDeltaParameterswithPerturbation(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.market.param.ParameterizedData
findParameterIndex
-
-
-
-
Method Detail
-
of
public static SmileDeltaParameters of(double expiry, DoubleArray delta, DoubleArray volatility)
Obtains an instance from volatility.GenericVolatilitySurfaceYearFractionParameterMetadatais used for parameter metadata.- Parameters:
expiry- the time to expiry associated to the datadelta- the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbersvolatility- the volatilities- Returns:
- the smile definition
-
of
public static SmileDeltaParameters of(double expiry, Tenor expiryTenor, DoubleArray delta, DoubleArray volatility)
Obtains an instance from volatility.GenericVolatilitySurfaceYearFractionParameterMetadatais used for parameter metadata.- Parameters:
expiry- the time to expiry associated to the dataexpiryTenor- the tenor associated with the expirydelta- the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbersvolatility- the volatilities- Returns:
- the smile definition
-
of
public static SmileDeltaParameters of(double expiry, DoubleArray delta, DoubleArray volatility, List<ParameterMetadata> parameterMetadata)
Obtains an instance from volatility.- Parameters:
expiry- the time to expiry associated to the datadelta- the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbersvolatility- the volatilitiesparameterMetadata- the parameter metadata- Returns:
- the smile definition
-
of
public static SmileDeltaParameters of(double expiry, double atmVolatility, DoubleArray delta, DoubleArray riskReversal, DoubleArray strangle)
Obtains an instance from market data at-the-money, delta, risk-reversal and strangle.GenericVolatilitySurfaceYearFractionParameterMetadatais used for parameter metadata.- Parameters:
expiry- the time to expiry associated to the dataatmVolatility- the at-the-money volatilitydelta- the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbersriskReversal- the risk reversal volatility figures, in the same order as the deltastrangle- the strangle volatility figures, in the same order as the delta- Returns:
- the smile definition
-
of
public static SmileDeltaParameters of(double expiry, Tenor expiryTenor, double atmVolatility, DoubleArray delta, DoubleArray riskReversal, DoubleArray strangle)
Obtains an instance from market data at-the-money, delta, risk-reversal and strangle.This factory allows the tenor to be included in the parameter metadata.
- Parameters:
expiry- the time to expiry associated to the dataexpiryTenor- the tenor associated with the expiryatmVolatility- the at-the-money volatilitydelta- the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbersriskReversal- the risk reversal volatility figures, in the same order as the deltastrangle- the strangle volatility figures, in the same order as the delta- Returns:
- the smile definition
-
of
public static SmileDeltaParameters of(double expiry, double atmVolatility, DoubleArray delta, DoubleArray riskReversal, DoubleArray strangle, List<ParameterMetadata> parameterMetadata)
Obtains an instance from market data at-the-money, delta, risk-reversal and strangle.- Parameters:
expiry- the time to expiry associated to the dataatmVolatility- the at-the-money volatilitydelta- the delta of the different data points, must be positive and sorted in ascending order, the put will have as delta the opposite of the numbersriskReversal- the risk reversal volatility figures, in the same order as the deltastrangle- the strangle volatility figures, in the same order as the deltaparameterMetadata- the parameter metadata- Returns:
- the smile definition
-
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
-
withParameter
public SmileDeltaParameters 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 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 SmileDeltaParameters 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 interfaceParameterizedData- Parameters:
perturbation- the perturbation to apply- Returns:
- a parameterized data instance based on this with the specified perturbation applied
-
strike
public DoubleArray strike(double forward)
Calculates the strikes in ascending order.The result has twice the number of values plus one as the delta/volatility. The put with lower delta (in absolute value) first, at-the-money and call with larger delta first.
- Parameters:
forward- the forward- Returns:
- the strikes
-
impliedStrikesDerivativeToExpiry
public DoubleArray impliedStrikesDerivativeToExpiry(double forward)
Calculates the derivatives of the implied strikes to expiry.- Parameters:
forward- the forward- Returns:
- the strikes
-
impliedStrikesDerivativeToSmileVols
public DoubleArray impliedStrikesDerivativeToSmileVols(double forward)
Calculates the derivatives of the implied strikes to volatility.- Parameters:
forward- the forward- Returns:
- the strikes
-
getExpiryTenor
public Optional<Tenor> getExpiryTenor()
Gets the tenor associated with the time to expiry, optional.- Returns:
- the optional value of the property, not null
-
meta
public static SmileDeltaParameters.Meta meta()
The meta-bean forSmileDeltaParameters.- Returns:
- the meta-bean, not null
-
metaBean
public SmileDeltaParameters.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getExpiry
public double getExpiry()
Gets the time to expiry associated with the data.- Returns:
- the value of the property
-
getDelta
public DoubleArray getDelta()
Gets the delta of the different data points. Must be positive and sorted in ascending order. The put will have as delta the opposite of the numbers. The array is typically[0.1, 0.25]. The at-the-money value of 0.5 is not included.- Returns:
- the value of the property
-
getVolatility
public DoubleArray getVolatility()
Gets the volatilities associated with the strikes. This will be of size(delta.size() * 2) + 1with the put with lower delta (in absolute value) first, at-the-money and call with larger delta first.- Returns:
- the value of the property
-
getParameterMetadata
public ImmutableList<ParameterMetadata> getParameterMetadata()
Gets the associated metadata. This will be of size(delta.size() * 2) + 1with the put with lower delta (in absolute value) first, at-the-money and call with larger delta first.- Returns:
- the value of the property
-
-