Class SsviFormulaData
- java.lang.Object
-
- com.opengamma.strata.pricer.impl.volatility.smile.SsviFormulaData
-
- All Implemented Interfaces:
SmileModelData
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class SsviFormulaData extends Object implements SmileModelData, org.joda.beans.ImmutableBean, Serializable
The data bundle for SSVI smile formula.The bundle contains the SSVI model parameters, ATM volatility, rho and eta.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
double
getEta()
Gets the eta parameters.int
getNumberOfParameters()
Obtains the number of model parameters.double
getParameter(int index)
Obtains a model parameter specified by the index.DoubleArray
getParameters()
Gets the model parameters.double
getRho()
Gets the rho parameter.double
getSigma()
Gets the sigma parameter.int
hashCode()
boolean
isAllowed(int index, double value)
Checks the value satisfies the constraint for a model parameter.static org.joda.beans.TypedMetaBean<SsviFormulaData>
meta()
The meta-bean forSsviFormulaData
.org.joda.beans.TypedMetaBean<SsviFormulaData>
metaBean()
static SsviFormulaData
of(double[] parameters)
Obtains an instance of the SSVI formula data.static SsviFormulaData
of(double sigma, double rho, double eta)
Obtains an instance of the SSVI formula data.String
toString()
SsviFormulaData
with(int index, double value)
Creates a new smile model data bundle with a model parameter replaced.SsviFormulaData
withEta(double eta)
Returns a copy of this instance with eta replaced.SsviFormulaData
withRho(double rho)
Returns a copy of this instance with rho replaced.SsviFormulaData
withSigma(double sigma)
Returns a copy of this instance with sigma replaced.
-
-
-
Method Detail
-
of
public static SsviFormulaData of(double sigma, double rho, double eta)
Obtains an instance of the SSVI formula data.- Parameters:
sigma
- the sigma parameter, ATM volatilityrho
- the rho parametereta
- the eta parameter- Returns:
- the instance
-
of
public static SsviFormulaData of(double[] parameters)
Obtains an instance of the SSVI formula data.The parameters in the input array should be in the order of sigma (ATM volatility), rho and eta.
- Parameters:
parameters
- the parameters- Returns:
- the instance
-
getSigma
public double getSigma()
Gets the sigma parameter.- Returns:
- the sigma parameter
-
getRho
public double getRho()
Gets the rho parameter.- Returns:
- the rho parameter
-
getEta
public double getEta()
Gets the eta parameters.- Returns:
- the eta parameter
-
withSigma
public SsviFormulaData withSigma(double sigma)
Returns a copy of this instance with sigma replaced.- Parameters:
sigma
- the new sigma- Returns:
- the new data instance
-
withRho
public SsviFormulaData withRho(double rho)
Returns a copy of this instance with rho replaced.- Parameters:
rho
- the new rho- Returns:
- the new data instance
-
withEta
public SsviFormulaData withEta(double eta)
Returns a copy of this instance with eta replaced.- Parameters:
eta
- the new eta- Returns:
- the new data instance
-
getNumberOfParameters
public int getNumberOfParameters()
Description copied from interface:SmileModelData
Obtains the number of model parameters.- Specified by:
getNumberOfParameters
in interfaceSmileModelData
- Returns:
- the number of model parameters
-
getParameter
public double getParameter(int index)
Description copied from interface:SmileModelData
Obtains a model parameter specified by the index.- Specified by:
getParameter
in interfaceSmileModelData
- Parameters:
index
- the index- Returns:
- the model parameter
-
isAllowed
public boolean isAllowed(int index, double value)
Description copied from interface:SmileModelData
Checks the value satisfies the constraint for a model parameter.The parameter is specified by
index
.- Specified by:
isAllowed
in interfaceSmileModelData
- Parameters:
index
- the indexvalue
- the value- Returns:
- true if allowed, false otherwise
-
with
public SsviFormulaData with(int index, double value)
Description copied from interface:SmileModelData
Creates a new smile model data bundle with a model parameter replaced.The parameter is specified by
index
and replaced byvalue
.- Specified by:
with
in interfaceSmileModelData
- Parameters:
index
- the indexvalue
- the value- Returns:
- the new bundle
-
meta
public static org.joda.beans.TypedMetaBean<SsviFormulaData> meta()
The meta-bean forSsviFormulaData
.- Returns:
- the meta-bean, not null
-
metaBean
public org.joda.beans.TypedMetaBean<SsviFormulaData> metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getParameters
public DoubleArray getParameters()
Gets the model parameters.This must be an array of length 3. The parameters in the array are in the order of sigma (ATM volatility), rho and eta. The constraints for the parameters are defined in
isAllowed(int, double)
.- Returns:
- the value of the property, not null
-
-