The Fourier cosine expansion is an alternative to the numerical integration via FFT presented in my last blog post. The main idea of the method is to solve the inverse Fourier integral by reconstructing the whole integral, not just the integrand, from its Fourier-cosine series expansion. The series coefficients are extracted directly from the integrand. For mathematical details see the paper of Fang.
A criterion for the computational efficiency of the method is the number of summands in the expansion needed to obtain a reliable and accurate option value. As the option value is not known one can either fix this number of summands N or by checking whether the absolute of the characteristic function is smaller than a predefined value |Φ(ω)| < ε. The following table shows the relation ship between ε and N.
In the table the price of a European call option (S0 = 100, K = 100, r = 0.02, T = 365d) under a Heston model with parameters Θ= 0.05, κ= 1.5, σ= 0.1, ρ= 0.9, v0 = 0.03. For comparison, the analytical value of the call option, obtained with the pricing formula of the original paper , is V = 8.84849