T - Type of the data needed for the volatility functionpublic abstract class VolatilityFunctionProvider<T extends SmileModelData> extends Object
| Constructor and Description |
|---|
VolatilityFunctionProvider() |
| Modifier and Type | Method and Description |
|---|---|
abstract double |
volatility(double forward,
double strike,
double timeToExpiry,
T data)
Calculates the volatility.
|
ValueDerivatives |
volatilityAdjoint(double forward,
double strike,
double timeToExpiry,
T data)
Calculates volatility and the adjoint (volatility sensitivity to forward, strike and model parameters).
|
abstract double |
volatilityAdjoint2(double forward,
double strike,
double timeToExpiry,
T data,
double[] volatilityD,
double[][] volatilityD2)
Computes the first and second order derivatives of the volatility.
|
public abstract double volatility(double forward,
double strike,
double timeToExpiry,
T data)
forward - the forward value of the underlyingstrike - the strike value of the optiontimeToExpiry - the time to expiry of the optiondata - the model datapublic ValueDerivatives volatilityAdjoint(double forward, double strike, double timeToExpiry, T data)
By default the derivatives are computed by central finite difference approximation. This should be overridden in each subclass.
forward - the forward value of the underlyingstrike - the strike value of the optiontimeToExpiry - the time to expiry of the optiondata - the model datapublic abstract double volatilityAdjoint2(double forward,
double strike,
double timeToExpiry,
T data,
double[] volatilityD,
double[][] volatilityD2)
The first derivative values will be stored in the input array volatilityD
The array contains, [0] Derivative w.r.t the forward, [1] the derivative w.r.t the strike, then followed by model
parameters.
Thus the length of the array should be 2 + (number of model parameters).
The second derivative values will be stored in the input array volatilityD2.
Only the second order derivative with respect to the forward and strike must be implemented.
The array contains [0][0] forward-forward; [0][1] forward-strike; [1][1] strike-strike.
Thus the size should be 2 x 2.
forward - the forward value of the underlyingstrike - the strike value of the optiontimeToExpiry - the time to expiry of the optiondata - the model datavolatilityD - the array used to return the first order derivativevolatilityD2 - the array of array used to return the second order derivativeCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.