GithubHelp home page GithubHelp logo

andrewlyasoff / smap Goto Github PK

View Code? Open in Web Editor NEW
22.0 1.0 7.0 1.22 MB

Julia and Python programs that implement some of the tools described in my book "Stochastic Methods in Asset Pricing" (SMAP), MIT Press 2017 (e.g., the method for computing the price of American call options and the construction of the early exercise premium in the Black-Scholes-Merton framework from section 18.4 in SMAP).

License: MIT License

Jupyter Notebook 97.20% Julia 2.80%
julia american-options juliadb market-data-handler monte-carlo-simulation multivariate-analysis parallel-computing black-scholes-merton python3 histograms

smap's Introduction

SMAP

This repository contains Julia and Python programs that implement some of the tools described in my book "Stochastic Methods in Asset Pricing" (SMAP), MIT Press 2017 (with some amendments and extensions that are not covered in the book). The Julia code (posted in both .ipynb and .jl formats and tested with v.1.1.0) is more recent and much faster. Among other things, the program for computing the price and the exercise boundary of American call options in the Black-Scholes-Merton framework (section 18.4 in SMAP) can now be completed in about 14 seconds, or 11 seconds on two CPU cores (Julia Version: 1.1.0, OS: Linux (x86_64-pc-linux-gnu), CPU: Intel(R) Core(TM) i7-8650U). In this setup Julia appears to run the fastest under Emacs/ESS. From practical point of view, the use of multiple CPU cores is not particularly meaningful, but serves the purpose of illustrating the way parallel computing can be implemented in this context. The Python version of the same program (single core) completes in about 1 min with 10 iterations and 78 grid points, whereas the Julia version uses 5,000 grid points and 23 iterations (to complete in 14 seconds). This approach is very different from the classical Monte Carlo, binomial lattice, or PDE methods.

Some more mundane tasks, such as storing, analyzing, and uploading market data (using JuliaDB), in addition to simulating multivariate normal samples for a given covariance matrix, building historams, etc., are also implemented and updated to the most recent Julia release.

A technical note: The archive 'HistoricalQuotes.tar' must be untarred in the same directory in which the .ipynb or .jl are located (the code assumes the existence of a subdirectory called 'HistoricalQuotes'). This can be done from within the notebook or REPL by executing the shell command (note the semicolon)

; tar xvf HistoricalQuotes.tar

smap's People

Contributors

andrewlyasoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

smap's Issues

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.