Git Product home page Git Product logo

evaxu1995 / implied-stock-probability-mass-function-from-market-european-option-prices Goto Github PK

View Code? Open in Web Editor NEW

This project forked from philipfelizarta/implied-stock-probability-mass-function-from-market-european-option-prices

0.0 0.0 0.0 837 KB

The purpose of this project is to retrieve a probability mass function from market call and put option european option prices. I use tensorflow and tensorflow_probability to learn the implied PMF.

Python 100.00%

implied-stock-probability-mass-function-from-market-european-option-prices's Introduction

Implied-Stock-Probability-Mass-Function-from-Market-European-Option-Prices

The purpose of this project is to retrieve a probability mass function from market call and put european option prices. I use tensorflow and tensorflow_probability to learn the implied PMF.

Option Price and Stock Price Probability Density

Parameterizing S(.) and Discretizing the Optimization Problem

Where z will be a learned vector, s_i will represent

x_i will is an element of the mesh spanning the moneyness of strike prices. Thus, the option prices can be estimated like such (N=1000 in the code)...

Continuity Regularization

To achieve "smooth" functions I utilized a neat regularization trick where I sum the square distances between neighboring parameters.

I chose to weigh the square difference between points by the inverse of the absolute difference between corrosponding mesh points because the mesh is not linear (its geometric so that I may concentrate on PMF on values near at-the-money).

Optimization Problem

I use tensorflow_probability to optimize this equation with L-BFGS.

Data

VIX Market Prices

alt text

alt text

SPX Market Prices

alt text

alt text

Results

VIX

VIX is interesting to study because the index has a clear negative skew but spikes very hard occassionally. Pricing options using a regular lognormal black-scholes model would yield terrible returns. From observing the implied PMF I retreive, we clearly see that the market does not use a lognormal distribution to price these options, but rather a multimodal one.

alt text

Gamma = 1e-5 LCA coefficient = 0.9 (Here I used absoute value instead of square difference on the log term for put and call loss, moreover I weighted the log loss to 0.9 and the normal square difference 1-0.9=0.1)

PMF from VIX European Call and Put Options

alt text

Predicted Call Option Prices (Blue) vs Ground Truth (Orange)

alt text

Model Call Option Residuals (Absolute Difference)

alt text

Predicted Put Option Prices (Blue) vs Ground Truth (Orange)

alt text

Model Put Option Residuals (Absolute Difference)

alt text

SPX

SPX serves as a sanity check for this project. Because SPX is an index of 500 carefully selected stocks, it should be very stable and obey traditional financial intuitions (a lognormal return). The results gathered in this project showcase how the PMF of SPX obeys these notions of lognormality more so than the VIX.

alt text

gamma is set to 1e-4 for SPX European Options, lognormal coefficient (square difference) = 0.5

PMF from SPX European Call and Put Options

alt text

Predicted Call Option Prices (Blue) vs Ground Truth (Orange)

alt text

Model Call Option Residuals (Absolute Difference)

alt text

Predicted Put Option Prices (Blue) vs Ground Truth (Orange)

alt text

Model Put Option Residuals (Absolute Difference)

alt text

implied-stock-probability-mass-function-from-market-european-option-prices's People

Contributors

philipfelizarta avatar

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.