March 14th, 2009, 5:16 pm
Hi,I am trying to use the FFT to calculate call prices in the Heston model according to Carr & Madan, but my code gives negative call prices for some strikes.I'm using the stable characteristic function suggested by e.g. Albrecher et al, but still get problems.However, it seems like the code works if I change the Simpson weighting to 1/3*(3 + ( -i )^j - delta) rather than the suggested 1/3*(3 + ( -1 )^j - delta).Would appreciate if anyone has any idea why this solves the problem or, maybe even better, why I get the problem in the first place.The code is provided below for reference.Thanks,Niklas function [c k] = HestonFFT(x,r)N = 4096; eta = 0.15; b = pi/eta;alpha = 0.75;u = (0:N-1) * eta;k = -b + (0:N-1) * 2*b/N;cf = HestonCF(alpha, u, x)% Simpson weightsS = 1/3 * (3 + (-1).^(1:N) - eye(1,N));f_FFT = exp(i*b*u) .* exp(-r*t) * cf .* S ./ (alpha^2 + alpha - u.^2 + i*(2*alpha+1)*u);FFT = fft(f_FFT);c = real(FFT .* exp(-alpha*k) / pi);end