Docs / nablatensor-quant / com.nablatensor.quant.transform

final class

CosMethod

The Fang-Oosterlee COS method: a European option price as a cosine series in the risk-neutral density of the log-return, reconstructed from a CharacteristicFunction. Spectral convergence — for a smooth density a few hundred terms give machine-precision accuracy, and a whole strike slice costs one pass of the same phi evaluations.

price = e^{-rT} * sum_{k=0}^{N-1}' Re{ phi(k pi / (b-a)) e^{-i k pi a / (b-a)} } * U_k

where [a, b] is the truncation range from the cumulants and U_k are the payoff cosine coefficients. Puts are taken from the call by parity.

Methods

static double price(CharacteristicFunction cf, OptionType type, double spot, double strike, double rate, double maturity)
static double price(CharacteristicFunction cf, OptionType type, double spot, double strike, double rate, double maturity, int terms, double rangeWidths)