Skip to content

A Program to calculate the price of American put or call option with Least Square Monte Carlo

License

Notifications You must be signed in to change notification settings

AlbertLin0327/Least-Square-Monte-Carlo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Least Square Monte Carlo for American Option

Followers Stars Issue Commit

Program Description

This program is to stimulate the price of an American option with given market informations (interest rate, volatility rate, ...). It uses Least Square Monte Carlo to estimate the price. Also,extra informations such as delta and RMSER is calculated. More features will be added in the near future. For futher discription and explanation, please refer to this document.

Basic Information

  • Author: Albert Lin
  • School: National Taiwna University
  • Version: Python3
  • Library: random math Numpy matplotlib

Usage

Prerequisites

  • Python 3.6 or up
  • git

Installation

  1. Cloning the repository
git clone https://github.com/AlbertLin0327/Least-Square-Monte-Carlo.git
cd Least-Square-Monte-Carlo
  1. Install Python dependencies
pip3 install dependency

or

python3 -m pip install -r dependency

Execution

  1. Run the program
python3 main.py
  1. Follow the input format
Enter the type of American Option, Put or Call
>>> Put

Enter: spot price, strike price, time interval, interest(%), dividend(%), volatility(%), period, stimulations
>>> 100 110 2.5 0.05 0.01 0.02 500 200000

-----------------------------
Price of Put: 97.64186831886784
Stdandard deviation: 0.0069054026599523555
Root Mean Sqaure Relative Error: 0.031627722872397346
-----------------------------

Enter the dS (porportion) to shift the Random Path to estimate delta. Better to have 0 < dS <= 0.1
>>> 0.08

-----------------------------
Price of p after 0.08 shift: 93.08540650524313
Stdandard deviation after 0.08 shift: 0.006583161759921405
Root Mean Sqaure Relative Error after 0.08 shift: 0.03162772287239734
Estimated Delta of p: -0.5695577267030885
-----------------------------
  • Put can be written in any cases or even p. It works the same for Call
  • Every market attributes should be seperate by a space and written in one line
  • Interest rate, dividend rate and volatility is require to be written in percentage
  • Periods and simulations should be integers
  • The relation between spot price and strike price is assumed as reasonable
  • dS is exepected not to be too big. Though you might have your own concern

Result

Distribution of the Monte Carlo sampled path

Random Seleceted Monte Carlo sampled path

Additional Information

Explanation: https://www.csie.ntu.edu.tw/~b08902127/Least_Square_Monte_Carlo.pdf
Introduction: https://www.csie.ntu.edu.tw/~b08902127/LSMC_Report.pdf

Links to Me!

Gmail Medium Facebook LinkedIn

Releases

No releases published

Packages

No packages published

Languages