# Volatility

Volatility can be used for :

• Measuring risks
• Defining position sizes
• Designing alpha factors
• Pricing options

## Annualized Volatility

Python implementation of calculating which company has the maximum volatility based on its prices can be found here.

## Rolling Window

Python implementation of using rolling-window strategy to calculate average can be found here.

## Exponentially Weighted Moving Average

The formula for calculating exponentially weighted moving average is as follows :

Here, r_n is the nth daily return and sigma_n is the nth estimate of the volatility. Lambda is a constant between 0 and 1 that defines how quickly weights on older data should decrease.

A high value of lambda (close to 1) will cause older data to matter relatively more in the calculation of sigma_n. A very low value of lambda would mean that the recent data matters more — in this case, the successively daily estimates of sigma_n themselves will be volatile.

# ARCH and GARCH Models

## The ARCH Model

• ARCH : Autoregressive Conditional Heteroscedastic.
• Autoregressive : Current values are somehow related to recent past values.
• Heteroscedastic : Variable that we are trying to model, may have different magnitudes of variability at different time points. Magnitude of variability is measured using variance. Read more about Heteroskedasticity in my post here.
• In an ARCH model, we must specify a lag parameter (m), to define the number of prior residual errors to include in the model.

ARCH models can be expressed as :

## The GARCH Model

• The GARCH model is an extension of ARCH model. It includes lag residual (m) terms together with lag variance terms (n). It incorporates moving average component together with the autoregressive component.
• A typical GARCH model can be expressed as the figure below. An example of GARCH model of the first order could be expressed as GARCH(1,1). A GARCH(0, m) model is equivalent to ARCH(m) model.

## The Startup

Get smarter at building your thing. Join The Startup’s +741K followers.

## The Startup

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +741K followers.

Written by

## Purva Singh

Hi! I am a tech enthusiast currently working on leveraging language technologies to solve financial use-cases! View my work here: https://purvasingh96.github.io ## The Startup

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +741K followers.