Giter Club home page Giter Club logo

hybridmontecarlo's Introduction

Hybrid Monte Carlo

This repository includes Pyhon and Julia modules and Jupyter notebooks for Monte Carlo simulation of mathematical finance models and instruments. It is intended for research and education purpose.

We provide a set of models that can be combined to form hybrid models for interest rates, FX and equities. Financial instruments are represented by individual payoff objects. The payoff objects are combined to form the contractual cash flows of the instrument.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Recommended Python environment is Anaconda. This project is based on Python, Jupyter Notebook and Julia. Important Python packages are Numpy, Pandas and Plotly and QuantLib. Julia models are derived from Python implementations.

Installing

Clone the repository via:

git clone https://github.com/sschlenkrich/HybridMonteCarlo.git

Start Anaconda, open a terminal and navigate to the folder of the local repository.

cd [path-to]/HybridMonteCarlo/

Create a new Anaconda Python Environment with required packages.

conda create --name [envname] --file Requirements.txt

Activate the new environment via:

conda activate [envname]

Install Julia language from https://julialang.org/. Also install PyJulia; used to run Julia from within Python.

pip install julia

PyJulia may need to be configured in a new Anaconda environment.

python
>>>import julia
>>>julia.install()
>>>exit()

Install QuantLib library via pip (QuantLib is not available via conda).

pip install quantlib

Now start Jupyter Notebook with:

jupyter notebook

This step should open a browser window. Navigate to:

[path-to]/HybridMonteCarlo/doc/MonteCarloSimulation.ipynb

Finally, the notebook can be executed by selecting the menu item.

Kernel > Restart & Run all

Inspect the output and have fun.

Repository Structure

  • doc/ - documentation and example jupyter notebooks
  • hybmc/ - source code
    • mathutils/ - auxilliary methods for implied volatility and linear regression
    • models/ - financial models used for simulation
    • products/ - financial products that provide payoff structures
    • simulations/ - Monte Carlo simulation and payoffs
    • termstructures/ - interest rate and volatility structures
    • wrappers/ - Python wrappers for Julia models and C++/QuantLib models

Data Files

There are currently no data files included in the project.

Models can be serialised and saved via pickle. We use this approach in the notebooks.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors and History

  • Sebastian Schlenkrich, October 2020 - Initial setup
  • Sebastian Schlenkrich, December 2020 - Add Julia to master

hybridmontecarlo's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.