public final class SabrParameters extends Object implements ParameterizedData, org.joda.beans.ImmutableBean, Serializable
This is used in interest rate modeling.
Each SABR parameter is a Curve defined by expiry.
The implementation allows for shifted SABR model.
The shift parameter is also Curve defined by expiry.
| Modifier and Type | Method and Description |
|---|---|
double |
alpha(double expiry)
Calculates the alpha parameter for time to expiry.
|
double |
beta(double expiry)
Calculates the beta parameter for time to expiry.
|
boolean |
equals(Object obj) |
Curve |
getAlphaCurve()
Gets the alpha (volatility level) curve.
|
Curve |
getBetaCurve()
Gets the beta (elasticity) curve.
|
DayCount |
getDayCount()
Gets the day count used to calculate the expiry year fraction.
|
Curve |
getNuCurve()
Gets the nu (volatility of volatility) curve.
|
double |
getParameter(int parameterIndex) |
int |
getParameterCount() |
ParameterMetadata |
getParameterMetadata(int parameterIndex) |
Curve |
getRhoCurve()
Gets the rho (correlation) curve.
|
SabrVolatilityFormula |
getSabrVolatilityFormula()
Gets the SABR volatility formula.
|
Curve |
getShiftCurve()
Gets the shift parameter of shifted SABR model.
|
int |
hashCode() |
static org.joda.beans.TypedMetaBean<SabrParameters> |
meta()
The meta-bean for
SabrParameters. |
org.joda.beans.TypedMetaBean<SabrParameters> |
metaBean() |
double |
nu(double expiry)
Calculates the nu parameter for time to expiry.
|
static SabrParameters |
of(Curve alphaCurve,
Curve betaCurve,
Curve rhoCurve,
Curve nuCurve,
Curve shiftCurve,
SabrVolatilityFormula sabrFormula)
Obtains an instance with shift from nodal curves and volatility function provider.
|
static SabrParameters |
of(Curve alphaCurve,
Curve betaCurve,
Curve rhoCurve,
Curve nuCurve,
SabrVolatilityFormula sabrFormula)
Obtains an instance without shift from nodal curves and volatility function provider.
|
double |
rho(double expiry)
Calculates the rho parameter for time to expiry.
|
double |
shift(double expiry)
Calculates the shift parameter for time to expiry.
|
String |
toString() |
double |
volatility(double expiry,
double strike,
double forward)
Calculates the volatility for given expiry, strike and forward rate.
|
ValueDerivatives |
volatilityAdjoint(double expiry,
double strike,
double forward)
Calculates the volatility and associated sensitivities.
|
SabrParameters |
withParameter(int parameterIndex,
double newValue) |
SabrParameters |
withPerturbation(ParameterPerturbation perturbation) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitfindParameterIndexpublic static SabrParameters of(Curve alphaCurve, Curve betaCurve, Curve rhoCurve, Curve nuCurve, SabrVolatilityFormula sabrFormula)
Each curve is specified by an instance of Curve, such as InterpolatedNodalCurve.
The curves must contain the correct metadata:
ValueType.YEAR_FRACTION
ValueType.SABR_ALPHA, ValueType.SABR_BETA,
ValueType.SABR_RHO or ValueType.SABR_NU
CurveInfoType.DAY_COUNT, if present on other curves it must match that on the Alpha
Curves.sabrParameterByExpiry(String, DayCount, ValueType).alphaCurve - the alpha curvebetaCurve - the beta curverhoCurve - the rho curvenuCurve - the nu curvesabrFormula - the SABR formulaSabrParameterspublic static SabrParameters of(Curve alphaCurve, Curve betaCurve, Curve rhoCurve, Curve nuCurve, Curve shiftCurve, SabrVolatilityFormula sabrFormula)
Each curve is specified by an instance of Curve, such as InterpolatedNodalCurve.
The curves 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
CurveInfoType.DAY_COUNT, if present on other curves it must match that on the alpha
Suitable curve metadata can be created using
Curves.sabrParameterByExpiry(String, DayCount, ValueType).
alphaCurve - the alpha curvebetaCurve - the beta curverhoCurve - the rho curvenuCurve - the nu curveshiftCurve - the shift curvesabrFormula - the SABR formulaSabrParameterspublic 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 SabrParameters withParameter(int parameterIndex, double newValue)
withParameter in interface ParameterizedDatapublic SabrParameters withPerturbation(ParameterPerturbation perturbation)
withPerturbation in interface ParameterizedDatapublic double alpha(double expiry)
expiry - the time to expiry as a year fractionpublic double beta(double expiry)
expiry - the time to expiry as a year fractionpublic double rho(double expiry)
expiry - the time to expiry as a year fractionpublic double nu(double expiry)
expiry - the time to expiry as a year fractionpublic double shift(double expiry)
expiry - the time to expiry as a year fractionpublic double volatility(double expiry,
double strike,
double forward)
expiry - the time to expiry as a year fractionstrike - the strikeforward - the forwardpublic ValueDerivatives volatilityAdjoint(double expiry, double strike, double forward)
The derivatives are stored in an array with:
expiry - the time to expiry as a year fractionstrike - the strikeforward - the forwardpublic static org.joda.beans.TypedMetaBean<SabrParameters> meta()
SabrParameters.public org.joda.beans.TypedMetaBean<SabrParameters> metaBean()
metaBean in interface org.joda.beans.Beanpublic Curve getAlphaCurve()
The x value of the curve is the expiry.
public Curve getBetaCurve()
The x value of the curve is the expiry.
public Curve getRhoCurve()
The x value of the curve is the expiry.
public Curve getNuCurve()
The x value of the curve is the expiry.
public Curve getShiftCurve()
The x value of the curve is the expiry. 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.