Skip to content

RSCAM Group 1 Project (Multilevel Monte Carlo for SDEs)

Notifications You must be signed in to change notification settings

mckeownish/Multilevel_MC_SDEs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 

Repository files navigation

Multilevel_MC_SDEs

RSCAM Group 1 Project (Multilevel Monte Carlo for SDEs)
OOP python module for option pricing using MLMC for University of Edinburgh MSc course, Research Skills in Computational Applied Maths. Implements and extends code from Mike Giles' software project [1]. See ExampleUsages.ipynb Jupyter notebook for demonstrations of the code functionality.

[1] M.B. Giles et. al. Multilevel Monte Carlo software, http://people.maths.ox.ac.uk/gilesm/mlmc/mlmc_software.html.

Contributors

Olena Balan
Chantal Kool
Isabell Linde
Josh McKeown
Luke Shaw

MLMC_RSCAM
Multilevel Monte Carlo Implementation for RSCAM Group 1
Luke Shaw, Olena Balan, Isabell Linde, Chantal Kool, Josh Mckeown
_______________________________________________________
Functions: Euro_payoff, Asian_payoff, Lookback_payoff, Digital_payoff, and anti_Euro_payoff payoffs.
(diffusion/JD)_path(_min/_avg) for diffusion and jump diffusion, coarse/fine final, avg, min asset prices.
(diffusion/JD)_asset_plot plotting functions for diffusion and jump diffusion asset prices.
Giles_plot plotting functions for mlmc variance/mean, samples per level/complexity and brownian_plot for discretised Brownian motion plots.
Use inspect.getmembers(mlmc_RSCAM,inspect.isroutine) to get full list.


Classes: Option, JumpDiffusion_Option, Diffusion_Option, Merton_Option, GBM_Option, MyOption.
With specific Euro_GBM/Euro_Merton, Lookback_GBM/Lookback_Merton, Asian_GBM/Asian_Merton, 
Digital_GBM/Digital_Merton implementations for Merton and GBM models. 
Use inspect.getmembers(mlmc_RSCAM,inspect.isclass) to get full list.

________________________________________________________
Example usage:
import MLMC_RSCAM as multi

opt = multi.Euro_GBM(X0=125,K=105,r=0.02,sig=0.5)
sums,N=opt.mlmc(eps=0.01)
print(sum(sums[0,:]/N),opt.BS()) #Compare BS price with mlmc-calculated price

eps=[0.005,0.1,0.2,0.25,0.3]
fig,ax=plt.subplots(2,2,figsize=(30,30))
markers=['o','s','x','d']
multi.Giles_plot(opt,eps,label='European GBM ', markers=markers,fig=fig,Nsamples=10**3) #Plot mean/variance/numbr of levels/complexity plot
opt.asset_plot(L=4,M=4) #Plot asset price on two discretisation levels