naginterfaces.library.specfun.opt_jumpdiff_merton_greeks¶
- naginterfaces.library.specfun.opt_jumpdiff_merton_greeks(calput, x, s, t, sigma, r, lamda, jvol)[source]¶
opt_jumpdiff_merton_greeks
computes the European option price together with its sensitivities (Greeks) using the Merton jump-diffusion model.For full information please refer to the NAG Library document for s30jb
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/s/s30jbf.html
- Parameters
- calputstr, length 1
Determines whether the option is a call or a put.
A call; the holder has a right to buy.
A put; the holder has a right to sell.
- xfloat, array-like, shape
must contain , the th strike price, for .
- sfloat
, the price of the underlying asset.
- tfloat, array-like, shape
must contain , the th time, in years, to expiry, for .
- sigmafloat
, the annual total volatility, including jumps.
- rfloat
, the annual risk-free interest rate, continuously compounded. Note that a rate of 5% should be entered as .
- lamdafloat
, the number of expected jumps per year.
- jvolfloat
The proportion of the total volatility associated with jumps.
- Returns
- pfloat, ndarray, shape
contains , the option price evaluated for the strike price at expiry for and .
- deltafloat, ndarray, shape
The leading part of the array contains the sensitivity, , of the option price to change in the price of the underlying asset.
- gammafloat, ndarray, shape
The leading part of the array contains the sensitivity, , of to change in the price of the underlying asset.
- vegafloat, ndarray, shape
, contains the first-order Greek measuring the sensitivity of the option price to change in the volatility of the underlying asset, i.e., , for and .
- thetafloat, ndarray, shape
, contains the first-order Greek measuring the sensitivity of the option price to change in time, i.e., , for and , where .
- rhofloat, ndarray, shape
, contains the first-order Greek measuring the sensitivity of the option price to change in the annual risk-free interest rate, i.e., , for and .
- vannafloat, ndarray, shape
, contains the second-order Greek measuring the sensitivity of the first-order Greek to change in the volatility of the asset price, i.e., , for and .
- charmfloat, ndarray, shape
, contains the second-order Greek measuring the sensitivity of the first-order Greek to change in the time, i.e., , for and .
- speedfloat, ndarray, shape
, contains the third-order Greek measuring the sensitivity of the second-order Greek to change in the price of the underlying asset, i.e., , for and .
- colourfloat, ndarray, shape
, contains the third-order Greek measuring the sensitivity of the second-order Greek to change in the time, i.e., , for and .
- zommafloat, ndarray, shape
, contains the third-order Greek measuring the sensitivity of the second-order Greek to change in the volatility of the underlying asset, i.e., , for and .
- vommafloat, ndarray, shape
, contains the second-order Greek measuring the sensitivity of the first-order Greek to change in the volatility of the underlying asset, i.e., , for and .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: and .
- (errno )
On entry, .
Constraint: and .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: and .
- Notes
opt_jumpdiff_merton_greeks
uses Merton’s jump-diffusion model (Merton (1976)) to compute the price of a European option, together with the Greeks or sensitivities, which are the partial derivatives of the option price with respect to certain of the other input parameters. Merton’s model assumes that the asset price is described by a Brownian motion with drift, as in the Black–Scholes–Merton case, together with a compound Poisson process to model the jumps. The corresponding stochastic differential equation is,Here is the instantaneous expected return on the asset price, ; is the instantaneous variance of the return when the Poisson event does not occur; is a standard Brownian motion; is the independent Poisson process and where is the random variable change in the stock price if the Poisson event occurs and is the expectation operator over the random variable .
This leads to the following price for a European option (see Haug (2007))
where is the time to expiry; is the strike price; is the annual risk-free interest rate; is the Black–Scholes–Merton option pricing formula for a European call (see
opt_bsm_price()
).where is the total volatility including jumps; is the expected number of jumps given as an average per year; is the proportion of the total volatility due to jumps.
The value of a put is obtained by substituting the Black–Scholes–Merton put price for .
The option price is computed for each strike price in a set , , and for each expiry time in a set , .
- References
Haug, E G, 2007, The Complete Guide to Option Pricing Formulas, (2nd Edition), McGraw-Hill
Merton, R C, 1976, Option pricing when underlying stock returns are discontinuous, Journal of Financial Economics (3), 125–144