Merton's Jump diffusion model.

In the following we look at an implementation of a special case of Merton's
model, described in (Hull, 1993, pg 454), where the size of the jump has a
normal distribution. and are parameters of the jump
distribution. The price of an European call option is

where

is the Black Scholes formula, and

In implementing this formula, we need to terminate the infinite sum at some point. But since the factorial function is growing at a much higher rate than any other, that is no problem, terminating at about should be on the conservative side. To avoid numerical difficulties, use the following method for calculation of

// file merton_jump_diff_call.cc // author: Bernt Arne Oedegaard #include <cmath> #include "fin_algoritms.h" double option_price_call_merton_jump_diffusion( double S, double X, double r, double sigma, double time_to_maturity, double lambda, double kappa, double delta) { const int MAXN=50; double tau=time_to_maturity; double sigma_sqr = sigma*sigma; double delta_sqr = delta*delta; double lambdaprime = lambda * (1+kappa); double gamma = log(1+kappa); double c = exp(-lambdaprime*tau)* option_price_call_black_scholes(S,X,sigma,r-lambda*kappa,tau); double log_n = 0; for (int n=1;n<=MAXN; ++n) { log_n += log(n); double sigma_n = sqrt( sigma_sqr+n*delta_sqr/tau ); double r_n = r-lambda*kappa+n*gamma/tau; c += exp(-lambdaprime*tau+n*log(lambdaprime*tau)-log_n)* option_price_call_black_scholes(S,X,sigma_n,r_n,tau); }; return c; };