Neural Networks in finance?: Markov Chain Monte Carlo (MCMC) and Stochastic Volatility Modelling

Aroa Gomez
Analytics Vidhya
Published in
5 min readJan 13, 2020

*** This post assumes basic knowledge of machine learning, econometrics modelling and options pricing . There will be no further explanation on some of the concepts below:

AR process, Stochastic Process, ARCH, Black-Scholes, Options pricing, Bayesian statistics

The aim of this post is to give the reader an intuitive introduction to Markov Chain Monte Carlo (MCMC) and show a practical application in the financial sector.

In financial markets volatility is one of the key components when assessing asset returns, asset allocation and risk. Traditionally, volatility has been modelled with autoregressive conditional heteroskedasticity (ARCH) models and its variations, however, with the introduction of Black-Scholes pricing in options SV started to draw more attention in the industry. One of the main drawbacks of Black-Scholes (1973 & 1976) is the assumption of constant volatility in the underlying asset which is rather unrealistic, SV models although can solve for this flaw. Considering the importance of volatility and its extensive literature, I thought it could be a good opportunity to introduce the topic as an application of MCMC.

Before we get into the math and depths of MCMC and volatility let’s start with a little bit of historical context.

Monte Carlo: the Gambling Capital of Europe

When was Monte Carlo method first introduced?

The Monte Carlo method was crucial for the simulations needed during the ‘Manhattan project’ during World War II to develop the first nuclear weapons.

In 1946 Von Neumman (better known as the father of Game Theory) and his colleague Ulam formalised the concept. They were investigating radiation shielding and the distance that neutrons would likely travel through various materials. Although they had enough data, the physicists in the lab were unable to solve the problem using conventional analytical math, then, Ulam had the idea of using random experiments with ‘truly random’ numbers.

At the time, this project was kept secret and they required a codename; it was Ulam who suggested the name of Monte Carlo. He got the inspiration from his uncle, who seemed to be an adept of ‘Casino de Monte-Carlo’ in Monaco where he would spend his time gambling family money.

MCMC Decomposition

MCMC is made out of two components: Markov Chain principles and Monte Carlo simulation method.

Monte Carlo Method: Monte Carlo Methods are algorithms that simply repeat random samples over and over to get to an ‘answer’ when traditional math (deterministic) cannot output a single result or when the problems are too complicated to be solved analytically.

Markov Chain: Markov Chain is formally an stochastic process, which is defined as a random variable that evolves through time. This process has the property that, given the present, the future is conditionally independent of the past.

In other words, knowing where you were in the previous period makes the rest of the chain history irrelevant. If we know Xt=j, where j is a state, then the rest of the history doesn’t add any information for predicting Xt+1; that’s why the two sides are equal, we only ‘care’ about the present state we are in Xt.

What do we need to compute MCMC?

As you might recall from Bayesian statistics, your starting point is to be able to compute the ‘prior’ likelihood, similarly, in a Markov Chain process, for any possible point in the space we need to know the ‘prior’ probability. In simple terms, you need to know something about your parameters.

We start at a random point and calculate the prior likelihood Px, based on where we are standing at time t. Next, we take a move in the parameter space using a proposal distribution. We draw a random step towards a new position, we then compute the ‘prior likelihood’ * ‘proposal likelihood’. After thousands of iterations you will arrive to a joint posterior distribution for your large dimensional space.

MCMC Application — Stochastic Volatility (SV)

As mentioned in the introduction, volatility estimation is key metric in capital markets. Since the deterministic assumption is not empirically observable, a stochastic approximation is considered to be a better estimation. MCMC is very computationally expensive and it’s not widely used in the industry, however, I would like to set the framework for those interested in the topic.

The Stochastic Volatility model is defined as:

Where: y= log return; h = log volatility; μ= mean of log volatility; φ= persistence of volatility term; ε = white noise (error) on asset return; 𝛿 = shock on volatility at time t.

MCMC Algorithm — two steps

The main difference between ARCH and SV models is that SV considers the volatility term h to have an unpredictable component, while ARCH considers volatility deterministic given that it’s an autoregressive process.

What does this means in computational terms?

Let’s consider θ a random vector, then using Bayes’ theorem we can denote its posterior distribution as

The volatility states h is based on the posterior distribution p(θ,h|y). Thus, the principle of MCMC inference is to simulate p(θ|y) with the likelihood function defined as:

Since the function is a T-dimensional integral problem and is not analytically solvable an estimation is needed. It’s in the 90’s when MCMC starts to be considered a valuable technique.

The principle of MCMC bayesian inference is to simulate p(θ|y) by generating a Markov Chain random sample draw.

Firstly we deploy Markov Chain generating a sequence of random variables converging to the posterior distribution p(θ,h|y), this is done by taking samples of h, µ, φ and σ for t = 1, . . . , T in the Markov Chain space given a transition kernel.

Next, Monte Carlo computes the posterior mean of the parameters to smooth the results.

Summary

  • MCMC has two components, Markov Chain process and Monte Carlo simulation.
  • MCMC is useful to solve integration and optimisation problems in large dimensional spaces.
  • Stochastic Volatility solves the problem of deterministic volatility in Black-Scholes pricing.

--

--