## Class NormalFormulaRepository

• java.lang.Object
• com.opengamma.strata.pricer.impl.option.NormalFormulaRepository

• public final class NormalFormulaRepository
extends Object
The primary location for normal model formulas.
• ### Method Summary

All Methods
Modifier and Type Method Description
static double delta​(double forward, double strike, double timeToExpiry, double normalVol, PutCall putCall)
Computes the delta.
static double gamma​(double forward, double strike, double timeToExpiry, double normalVol, PutCall putCall)
Computes the gamma.
static double impliedVolatility​(double optionPrice, double forward, double strike, double timeToExpiry, double initialNormalVol, double numeraire, PutCall putCall)
Computes the implied volatility.
static double impliedVolatilityFromBlackApproximated​(double forward, double strike, double timeToExpiry, double blackVolatility)
Compute the implied volatility using an approximate explicit transformation formula.
static ValueDerivatives impliedVolatilityFromBlackApproximatedAdjoint​(double forward, double strike, double timeToExpiry, double blackVolatility)
Compute the implied volatility using an approximate explicit transformation formula and its derivative with respect to the input Black volatility.
static double price​(double forward, double strike, double timeToExpiry, double normalVol, PutCall putCall)
Computes the forward price.
static ValueDerivatives priceAdjoint​(double forward, double strike, double timeToExpiry, double normalVol, double numeraire, PutCall putCall)
Computes the price and first order derivatives.
static double theta​(double forward, double strike, double timeToExpiry, double normalVol, PutCall putCall)
Computes the theta.
static double vega​(double forward, double strike, double timeToExpiry, double normalVol, PutCall putCall)
Computes the vega.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Method Detail

• #### price

public static double price​(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Computes the forward price.

Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.

Parameters:
forward - the forward value of the underlying
strike - the strike
timeToExpiry - the time to expiry
normalVol - the normal volatility
putCall - whether it is put or call
Returns:
the forward price

public static ValueDerivatives priceAdjoint​(double forward,
double strike,
double timeToExpiry,
double normalVol,
double numeraire,
PutCall putCall)
Computes the price and first order derivatives.

The derivatives are stored in an array with:

•  derivative with respect to the forward
•  derivative with respect to the volatility
•  derivative with respect to the strike
Parameters:
forward - the forward value of the underlying
strike - the strike
timeToExpiry - the time to expiry
normalVol - the normal volatility
numeraire - the numeraire
putCall - whether it is put or call
Returns:
the price and associated derivatives
• #### delta

public static double delta​(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Computes the delta.

Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.

Parameters:
forward - the forward value of the underlying
strike - the strike
timeToExpiry - the time to expiry
normalVol - the normal volatility
putCall - whether it is put or call
Returns:
the delta
• #### gamma

public static double gamma​(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Computes the gamma.

Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.

Parameters:
forward - the forward value of the underlying
strike - the strike
timeToExpiry - the time to expiry
normalVol - the normal volatility
putCall - whether it is put or call
Returns:
the gamma
• #### theta

public static double theta​(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Computes the theta.

Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.

Parameters:
forward - the forward value of the underlying
strike - the strike
timeToExpiry - the time to expiry
normalVol - the normal volatility
putCall - whether it is put or call
Returns:
the theta
• #### vega

public static double vega​(double forward,
double strike,
double timeToExpiry,
double normalVol,
PutCall putCall)
Computes the vega.

Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.

Parameters:
forward - the forward value of the underlying
strike - the strike
timeToExpiry - the time to expiry
normalVol - the normal volatility
putCall - whether it is put or call
Returns:
the vega
• #### impliedVolatility

public static double impliedVolatility​(double optionPrice,
double forward,
double strike,
double timeToExpiry,
double initialNormalVol,
double numeraire,
PutCall putCall)
Computes the implied volatility.

If the volatility data is not zero, it is used as a starting point for the volatility search.

Note that the 'numeraire' is a simple multiplier and is the responsibility of the caller.

Parameters:
optionPrice - the price of the option
forward - the forward value of the underlying
strike - the strike
timeToExpiry - the time to expiry
initialNormalVol - the normal volatility used to start the search
numeraire - the numeraire
putCall - whether it is put or call
Returns:
the implied volatility
• #### impliedVolatilityFromBlackApproximated

public static double impliedVolatilityFromBlackApproximated​(double forward,
double strike,
double timeToExpiry,
double blackVolatility)
Compute the implied volatility using an approximate explicit transformation formula.

Reference: Hagan, P. S. Volatility conversion calculator. Technical report, Bloomberg.

Parameters:
forward - the forward rate/price
strike - the option strike
timeToExpiry - the option time to maturity
blackVolatility - the Black implied volatility
Returns:
the implied volatility

public static ValueDerivatives impliedVolatilityFromBlackApproximatedAdjoint​(double forward,
double strike,
double timeToExpiry,
double blackVolatility)
Compute the implied volatility using an approximate explicit transformation formula and its derivative with respect to the input Black volatility.

Reference: Hagan, P. S. Volatility conversion calculator. Technical report, Bloomberg.

Parameters:
forward - the forward rate/price
strike - the option strike
timeToExpiry - the option time to maturity
blackVolatility - the Black implied volatility
Returns:
the implied volatility and its derivative