Skip to content

I wrote a Master's in Finance thesis on Monte Carlo simulation of the Multifractal Model of Asset Returns. This is a model developed in the late 1990's by Benoît Mandelbrot and his two students, Laurent Calvet and Adlai Fisher. I had never programmed before and this was my first big coding project — so sorry if the code sucks! I did what I could :)

Deckstar/Multifractal-Model-of-Asset-Returns-MMAR-for-Thesis

Repository files navigation

#############################################

DO NOT TRY TO RUN THIS CODE! 

It would take you 60+ hours…

#############################################


Welcome to the code package for my Master's thesis!

In this folder, you will find FOUR types of files:
1) The MAIN CODE file (the bulk of the analysis)
2) Three extra code files
3) Four HTML files (for easily reading the code)
4) My Master's thesis as a PDF file

All the main files for the thesis are in the main folder.

The “Extra Code” contains extra experiments, such as the high-kurtosis graphs, the trader bankruptcy simulation games, and the H-index measurements for various exchange rates. There is also a diagram for how to construct an MMAR simulation.

The “HTML versions” folder contains the code as HTML files, which can be opened and viewed very easily and conveniently in any internet browser (Google Chrome, Safari, Mozilla Firefox, Opera etc.) I recommend the HTML files as the best for viewing the code!

(Note: unfortunately, Github doesn't seem to let you just download the file directly. To open the HTML file, I opened the "raw" text version, scrolled down to the bottom to load all the text, copy pasted it into a text application and saved it as "MAIN CODE.html". After that, a simply double click opened it in my browser.)


#############################################
CODE — How to open and how to replicate
#############################################
The main code file is called “MAIN CODE.ipynb”.

The programming language I used was Python 3. Python usually needs to be installed for a computer.

I used a special interface that’s very convenient for data analysis, called Jupyter Lab. There, the code can be seen line by line in “notebooks”.

If you wish to open the code and run it, the best way to do this is to install the Jupyter Lab interface. This can be done by installing a software package called Anaconda at https://www.anaconda.com

As a final comment: you would not get exactly the same results as I did, if you did decide to run this code. This is because there is a considerable amount of randomness in it (it's all about Monte Carlo simulations, after all). Unfortunately, I did not know about "random seeds" when I made this, so many of the precise numbers are lost to the sands of time.


#############################################
DATA
#############################################
I didn't include the data in this Github folder, because I didn't feel like taking up space pointlessly. But I will mention the path names for the data:

The main data package was the one called “Data for Jupyter Lab.csv”. It contained daily price data for three financial markets, over approximately 30 years.

The second data package (“Data for Jupyter Lab — MORE COUNTRIES.csv”) contained similar data on various exchange rates. This data was NOT very important for the thesis.


#############################################
Personal comments on the thesis and the MMAR
#############################################

I had a lot of fun working on this thesis. It was my first experience with Python programming, even if it was just some basic data analysis in Jupyter Lab - so sorry if the code sucks in some ways! I did what I could under time pressure :)

If you're working on a similar academic project (or maybe even a personal one!), then I hope my code and the thesis can be useful for you. I wasted a lot of hours just trying to figure out what the model meant and how to code it, so hopefully I can save you some time with this! I tried to write things in a way that would make it easy for a newcomer to understand, but of course that is always easier said than done.

(Finally, if you're curious, my final grade was a B, but I really hoped for an A :p It's a hard life.) But at least I could learn about fractals, Chaos theory and Python programming  ^_^

Feel free to message me on Github if you have any questions about the code or how the MMAR works! (Although please know that I don't visit this website often, so I may not be able to respond quickly.)

About

I wrote a Master's in Finance thesis on Monte Carlo simulation of the Multifractal Model of Asset Returns. This is a model developed in the late 1990's by Benoît Mandelbrot and his two students, Laurent Calvet and Adlai Fisher. I had never programmed before and this was my first big coding project — so sorry if the code sucks! I did what I could :)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published