%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Option pricer for European option under Merton jump-diffusion model using %%% the quadrature of Fourier transform of option value %%% %%% Copyright (C) 2008 Vladimir Surkov %%% %%% %%% This program is free software: you can redistribute it and/or modify %%% it under the terms of the GNU General Public License as published by %%% the Free Software Foundation, either version 3 of the License, or %%% (at your option) any later version. %%% %%% This program is distributed in the hope that it will be useful, %%% but WITHOUT ANY WARRANTY; without even the implied warranty of %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %%% GNU General Public License for more details. %%% %%% You should have received a copy of the GNU General Public License %%% along with this program. If not, see . %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [values_call, values_put, time] = FourierProductQuadrature_European_MertonJumpDiffusion(S, K, T, sigma, lambda, mu, nu, r, q) values_call = zeros(length(S), length(K)); values_put = zeros(length(S), length(K)); time = cputime; process_drift = lambda*(exp(mu+0.5*nu^2)-1); for iter_s = 1:length(S) for iter_k = 1:length(K) %Set FT transforms of payoff and pdf payoff_ft = @(u)(exp(log(K(iter_k))*(1+i*u))./(i*u.*(1+i*u))); dist_ft = @(u)(exp(i*u*log(S(iter_s))+i*u*(r-q-sigma^2/2-process_drift)*T-u.^2*sigma^2*T/2 + lambda*(exp(i*mu*u-0.5*(nu*u).^2)-1)*T)); integrand = @(u)(exp(-r*T)*real(payoff_ft(u+1.1i).*dist_ft(-(u+1.1i)))); values_call(iter_s, iter_k) = quad(integrand, -8.0, 8.0)/(2*pi); integrand = @(u)(exp(-r*T).*payoff_ft(u-0.1i).*dist_ft(-(u-0.1i))); values_put(iter_s, iter_k) = quad(integrand, -8.0, 8.0)/(2*pi); end end time = cputime - time;