Volatility, GARCH and You

Blockforce Capital
Blockforce Capital Blog
5 min readJun 13, 2019

You’re a vigilant investor, carefully watching the price of your favorite digital asset. Suddenly, the price starts increasing and decreasing in a seemingly erratic manner, making it hard to predict future behavior. Is it too risky to invest? How do we measure this chaos?

What you are observing is known as volatility, and in this Tech Corner piece, we’ll be going through two different ways to model and measure this metric using Python.

Volatility

First, an introduction to volatility. soHistorical volatility is the variance in the returns of an asset over a given period of time. The larger the variance, the greater the historical volatility. Typically, high volatility is associated with riskier assets. In the traditional financial markets, volatility is usually measured over a 14-day period. So the measure of volatility for any given day, is based on the variance in the asset returns from the previous 13 days as well.

The most important thing about volatility is that there is no ‘correct’ value. There are only methods for estimation. Because of this, there are multiple modes of measurement, each with their own pros and cons.

Data

The asset we will be exploring in this exercise is bitcoin. Besides being the largest digital asset by market capitalization, bitcoin’s volatility displays interesting characteristics that make it an ideal example to model using both methods described today. For our purposes, the bitcoin data will consist of 30-minute price data from Coinbase, ranging from January 1, 2017 until April 30, 2019. The data is available to download here.

Requirements

To follow along, you will need the necessary tools:

  • Python > 3.6
  • Arch v. 4.6.0
  • Pandas v. 0.24.2
  • Matplotlib v. 3.1.0
  • Tqdm v. 4.32.1

Your import statements should look like this:

Blockforce Capital

The necessary packages for python can be installed via pip.

Classical Method

Historically, volatility has been measured by taking the rolling standard deviation of an asset’s price percent changes, over a given time period.

Blockforce Capital

To convert the volatility from a short-term measurement to a long-term metric, it must be annualized. This can be done by multiplying the measure by the annualization factor, the total number of trading periods for the asset in a year. Bitcoin trades 24/7/365, so with 30 minute periods, we have 48*365 = 17,520 trading periods a year. This is different than the calculation for stocks, and usually, the value of 260 is used as there are 260 stock trading days per year.

Blockforce Capital

Annualizing the measurement will give an idea of how the asset will behave over the course of a year.

Although the classic method serves as a useful starting point, it does possess a notable flaw. All points in the time period are given an equal weight, so if a highly volatile point leaves this time range, the volatility will suddenly drop.

Blockforce Capital Research

In the figure shown, the absolute percent change describes how bitcoin’s price fluctuated over time. When points with a large percent change enter the 14-day volatility window, the volatility spikes, and then discontinuously drops once that point is no longer a part of the time range.

An example of this phenomenon can be seen in the period right before April 2017. A price change of about 17 percent caused the volatility to increase dramatically from 60 to 120. Once that point was no longer in the 14 day observation window, the volatility dropped down to 90.

GARCH

One of the alternates to the classic method utilizes a Generalized Auto-Regressive Conditional Heteroskedasticity (GARCH) model. Rather than giving equal weight to each observation in the time period like the classic method, this model gives newer points a higher weight than older points. This means that the more recent observations will have a greater effect on the volatility measure than older points. Or in other words: the GARCH measure has less of a lag compared to the current market situation.

Blockforce Capital

GARCH models are not an automatic replacement for the classical method, as they can only be used in a specific circumstance. This would be when the model exhibits “conditional heteroskedasticity,” meaning that the variance of the model randomly experiences periods with greatly increased or decreased variance. That’s certainly the case for bitcoin!

Results

When the measures from the GARCH model and the classical method are plotted together, we notice some interesting trends.

Blockforce Capital Research

The first is that unlike the classical method, the GARCH model can predict volatility in the future. This can help give an idea of how the digital asset will behave in the future, acting, possibly, as a signal for whether or not it will be too risky.

The second thing we notice is that the GARCH model follows the same overall trend as the classical method, without experiencing the same sudden minute increases and decreases. Because the points in a 14-day GARCH window are not weighted equally, the highly volatile points no longer cause the volatility measure to change as drastically as the classic version. Overall, this results in a smoother measure of Bitcoin’s 14-day volatility.

Conclusion

When it comes to investing in speculative assets, the name of the game is risk, and volatility is one of the ways that risk can be quantified. The classical method of measuring volatility serves as an acceptable baseline, however more sophisticated models can produce more advantageous results. This can be seen in the relationship of the GARCH measure to its classical counterpart.

Thanks for joining us for this Tech Corner piece, for more content like this, please don’t forget to subscribe below.

Blockforce Capital does not recommend that the information presented herein serve as the basis of any investment decision. The information is given in summary form and does not purport to be complete. The sole purpose of this material is to inform, and in no way is intended to be an offer or solicitation to purchase or sell any security, other investment or services, or to attract any funds or deposits.

--

--

Blockforce Capital
Blockforce Capital Blog

Financial innovation at the intersection of capital markets, technology, and digital assets.