public final class SabrInterestRateParameters extends Object implements ParameterizedData, org.joda.beans.ImmutableBean, Serializable
This is used in interest rate modeling.
Each SABR parameter is a Surface defined by expiry and tenor.
The implementation allows for shifted SABR model.
The shift parameter is also Surface defined by expiry and tenor.
| Modifier and Type | Method and Description |
|---|---|
double |
alpha(double expiry,
double tenor)
Calculates the alpha parameter for a pair of time to expiry and instrument tenor.
|
double |
beta(double expiry,
double tenor)
Calculates the beta parameter for a pair of time to expiry and instrument tenor.
|
boolean |
equals(Object obj) |
Surface |
getAlphaSurface()
Gets the alpha (volatility level) surface.
|
Surface |
getBetaSurface()
Gets the beta (elasticity) surface.
|
DayCount |
getDayCount()
Gets the day count used to calculate the expiry year fraction.
|
Surface |
getNuSurface()
Gets the nu (volatility of volatility) surface.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
Surface |
getRhoSurface()
Gets the rho (correlation) surface.
|
SabrVolatilityFormula |
getSabrVolatilityFormula()
Gets the SABR volatility formula.
|
Surface |
getShiftSurface()
Gets the shift parameter of shifted SABR model.
|
int |
hashCode() |
static org.joda.beans.TypedMetaBean<SabrInterestRateParameters> |
meta()
The meta-bean for
SabrInterestRateParameters. |
org.joda.beans.TypedMetaBean<SabrInterestRateParameters> |
metaBean() |
double |
nu(double expiry,
double tenor)
Calculates the nu parameter for a pair of time to expiry and instrument tenor.
|
static SabrInterestRateParameters |
of(Surface alphaSurface,
Surface betaSurface,
Surface rhoSurface,
Surface nuSurface,
SabrVolatilityFormula sabrFormula)
Obtains an instance without shift from nodal surfaces and volatility function provider.
|
static SabrInterestRateParameters |
of(Surface alphaSurface,
Surface betaSurface,
Surface rhoSurface,
Surface nuSurface,
Surface shiftSurface,
SabrVolatilityFormula sabrFormula)
Obtains an instance with shift from nodal surfaces and volatility function provider.
|
double |
rho(double expiry,
double tenor)
Calculates the rho parameter for a pair of time to expiry and instrument tenor.
|
double |
shift(double expiry,
double tenor)
Calculates the shift parameter for a pair of time to expiry and instrument tenor.
|
String |
toString() |
double |
volatility(double expiry,
double tenor,
double strike,
double forward)
Calculates the volatility for given expiry, tenor, strike and forward rate.
|
ValueDerivatives |
volatilityAdjoint(double expiry,
double tenor,
double strike,
double forward)
Calculates the volatility and associated sensitivities.
|
SabrInterestRateParameters |
withParameter(int parameterIndex,
double newValue) |
SabrInterestRateParameters |
withPerturbation(ParameterPerturbation perturbation) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitfindParameterIndexpublic static SabrInterestRateParameters of(Surface alphaSurface, Surface betaSurface, Surface rhoSurface, Surface nuSurface, SabrVolatilityFormula sabrFormula)
Each surface is specified by an instance of Surface, such as InterpolatedNodalSurface.
The surfaces must contain the correct metadata:
ValueType.YEAR_FRACTION
ValueType.YEAR_FRACTION
ValueType.SABR_ALPHA, ValueType.SABR_BETA,
ValueType.SABR_RHO or ValueType.SABR_NU
SurfaceInfoType.DAY_COUNT, if present on other surfaces it must match that on the Alpha
Surfaces.sabrParameterByExpiryTenor(String, DayCount, ValueType).alphaSurface - the alpha surfacebetaSurface - the beta surfacerhoSurface - the rho surfacenuSurface - the nu surfacesabrFormula - the SABR formulaSabrInterestRateParameterspublic static SabrInterestRateParameters of(Surface alphaSurface, Surface betaSurface, Surface rhoSurface, Surface nuSurface, Surface shiftSurface, SabrVolatilityFormula sabrFormula)
Each surface is specified by an instance of Surface, such as InterpolatedNodalSurface.
The surfaces must contain the correct metadata:
ValueType.YEAR_FRACTION
ValueType.YEAR_FRACTION
ValueType.SABR_ALPHA, ValueType.SABR_BETA,
ValueType.SABR_RHO or ValueType.SABR_NU as appropriate
SurfaceInfoType.DAY_COUNT, if present on other surfaces it must match that on the alpha
Suitable surface metadata can be created using
Surfaces.sabrParameterByExpiryTenor(String, DayCount, ValueType).
alphaSurface - the alpha surfacebetaSurface - the beta surfacerhoSurface - the rho surfacenuSurface - the nu surfaceshiftSurface - the shift surfacesabrFormula - the SABR formulaSabrInterestRateParameterspublic DayCount getDayCount()
public int getParameterCount()
getParameterCount in interface ParameterizedDatapublic double getParameter(int parameterIndex)
getParameter in interface ParameterizedDatapublic ParameterMetadata getParameterMetadata(int parameterIndex)
getParameterMetadata in interface ParameterizedDatapublic SabrInterestRateParameters withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDatapublic SabrInterestRateParameters withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatapublic double alpha(double expiry,
double tenor)
expiry - the time to expiry as a year fractiontenor - the tenor of the instrument as a year fractionpublic double beta(double expiry,
double tenor)
expiry - the time to expiry as a year fractiontenor - the tenor of the instrument as a year fractionpublic double rho(double expiry,
double tenor)
expiry - the time to expiry as a year fractiontenor - the tenor of the instrument as a year fractionpublic double nu(double expiry,
double tenor)
expiry - the time to expiry as a year fractiontenor - the tenor of the instrument as a year fractionpublic double shift(double expiry,
double tenor)
expiry - the time to expiry as a year fractiontenor - the tenor of the instrument as a year fractionpublic double volatility(double expiry,
double tenor,
double strike,
double forward)
expiry - the time to expiry as a year fractiontenor - the tenor as a year fractionstrike - the strikeforward - the forwardpublic ValueDerivatives volatilityAdjoint(double expiry, double tenor, double strike, double forward)
The derivatives are stored in an array with:
expiry - the time to expiry as a year fractiontenor - the tenor of the instrument as a year fractionstrike - the strikeforward - the forwardpublic static org.joda.beans.TypedMetaBean<SabrInterestRateParameters> meta()
SabrInterestRateParameters.public org.joda.beans.TypedMetaBean<SabrInterestRateParameters> metaBean()
metaBean in interface org.joda.beans.Beanpublic Surface getAlphaSurface()
The first dimension is the expiry and the second the tenor.
public Surface getBetaSurface()
The first dimension is the expiry and the second the tenor.
public Surface getRhoSurface()
The first dimension is the expiry and the second the tenor.
public Surface getNuSurface()
The first dimension is the expiry and the second the tenor.
public Surface getShiftSurface()
The first dimension is the expiry and the second the tenor. The shift is set to be 0 unless specified.
public SabrVolatilityFormula getSabrVolatilityFormula()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.