Aims:

An introduction to numerical/computational methods with programming/exercises (Matlab, C++, Python) and an emphasis on applications in finance (derivatives pricing with Monte Carlo and Fourier transform methods, model calibration, etc.).

Learning outcomes:

On successful completion of the module, a student will be able to:

Demonstrate programming proficiency and skills in turning mathematical equations and models into working code.
	Demonstrate capacity to solve practical problems in financial mathematics applying modern numerical techniques.
Content:

Introduction: Programming languages, programming basics, data types, operators, expressions, control structures (sequential, conditional and iterated execution), vector/array operations, input/output, plots, style, floating-point representation of real numbers, numerical errors.
	Fundamental probability distributions: Normal, exponential, log-normal, chi square, plot of their PDF and CDF, sampling with pseudo-random numbers, histograms, transformation from uniform to other distributions using the quantile function.
	Random numbers: Linear congruential generators, requirements and statistical tests, pathologic cases, more advanced generators, inversion and transformation in one and more dimensions, acceptance-rejection method, Box-Muller method for normal deviates, polar method by Marsaglia, Ziggurat algorithm by Marsaglia and Tsang, correlated normal random variates, quasi-random numbers.
	Monte Carlo: Diffusion equation, Fokker-Planck equation, Kolmogorov backward equation, stochastic differential equation, Ito’s formula, Feynman-Kac theorem, Black-Scholes-Merton equation, risk-neutral valuation of options, Euler-Maruyama algorithm for the numerical solution of a stochastic differential equation, approximation error, strong and weak solution, Milstein algorithm.
	Drift-diffusion processes: Arithmetic and geometric Brownian motion, Ornstein-Uhlenbeck process and Vasicek model, Feller square-root process and Cox-Ingersoll-Ross model, constant elasticity of variance processes, Brownian bridge, Heston stochastic volatility model.
	Jump-diffusion processes: Poisson and normal compound Poisson process, finite-activity jump-diffusion processes (Merton, Kou), time-changed Brownian motion (variance gamma, normal inverse Gaussian, CGMY), Lévy processes.
	European options: A simple program that prices European calls and puts with the analytical solution, the Fourier transform, and Monte Carlo.
	Fourier transform: Definitions, inverse transform, properties, notable transform pairs (double-sided exponential/Lorentzian, Dirac delta/1, rectangular pulse/sinc, Gaussian/Gaussian), discrete and fast Fourier transform, characteristic function, moment- and cumulant-generating functions, correlation/convolution theorem, auto/cross-covariance and correlation, Parseval/Plancherel theorem, shift theorem, pricing in Fourier space.
	Model calibration: Implied volatility, Newton-Raphson method, Jäckel's equivalent form, Jäckel's modification, complex initial guess, attraction basin, fractals.
	Exotic options: Fourier transform methods for the numerical pricing of discretely and continuously monitored path-dependent options (barrier, hindsight, etc.).
	Partial differential equations: Classification of second-order PDEs (elliptic, parabolic and hyperbolic) with examples, finite difference methods.
Requisites:

To be eligible to select this module as optional or elective, a student must: (1) be registered on a programme and year of study for which it is a formally available; (2) also select Financial Engineering (COMP0048); and (3) take the non-examined support course ‘Introduction to Mathematics and Programming for Finance’.