Skip to content
All library documents

Setting EWMA Volatility Weights from a Half-Life and Lookback

Article Quant Q&A · Author: Dhruv Mahajan

Summary

The document explains how an exponentially weighted moving average (EWMA) assigns declining weight to older observations when estimating variance. It gives equivalent ways to express the decay, including a half-life: after that many time steps, an observation’s weight is half its initial value. The decay factor can therefore be derived from the half-life, and finite lookback weights can be normalized to sum to one.

For volatility, the method applies the weights to squared deviations of returns from an estimated mean. A one-year lookback limits which observations are included, while a three-month half-life controls how quickly their weights decline. The half-life must be converted into the sampling units: the document gives 63 trading days for daily returns and three observations for monthly returns. One answer treats three months as a quarter of a year and derives a decay factor, but this depends on the step-size convention. The document does not assess forecasting performance or specify how to estimate the mean.

Key ideas

  • An EWMA gives exponentially less weight to older observations.
  • The half-life is the age at which an observation’s weight falls to half its initial value.
  • A decay factor can be derived from the half-life once the time-step units are specified.
  • A finite lookback truncates the observations, and weights may be normalized to sum to one.
  • For volatility estimation, EWMA weights are applied to squared return deviations.

Tags

Full text
# Half-life of Exponentially Weighted Moving Average


# Half-life of Exponentially Weighted Moving Average












I am trying to apply a volatility strategy. I am reading a paper where the authors defined the volatility as: "Exponential Weighted Volatility of returns with a 1-year window and 3-month half-life"

I am having a hard time understanding the mathematical formula underlying it. The 1-year window part is easily understood as a summation of weighted square return deviation up to 12 months back. I think that the 3-month half-life is used for the weights but cannot figure out the exact mathematical representation. Any help on this is appreciated.

## Answer by Cettt (score 18, accepted)

https://quant.stackexchange.com/a/46197

The Exponentially Weighted Moving Average (EWMA for short) is characterized my the size of the lookback window $N$ and the decay parameter $\lambda$.

The corresponding volatility forecast is then given by: $$ \sigma_t^2 = \sum_{k = 0}^N \lambda^k x_{t-k}^2 $$

Sometimes the above expression is normed such that the sum of the weights is equal to one. However, for large $N$ this makes no difference.

Coming to your question, instead of providing $\lambda$ the half-life $\tau$ can be provided as well. The half-life is the time lag at which the exponential weights decay by one half, i.e. $$ \lambda^\tau = \frac 12 \iff \tau = - \frac{\ln2}{\ln \lambda} \iff \lambda = \biggl(\frac 12\biggr)^{\frac 1\tau}. $$

In your case $\tau = \frac 14$ which means that after 3 months the weights in the EWMA are less or equal than $\frac 12$. The corresponding value for $\lambda$ is then given by $\lambda = \bigl(\frac 12\bigr)^{\frac 1\tau} = \frac {1}{16}$.

## Answer by wissam124 (score 0)

https://quant.stackexchange.com/a/85755

#### EWMA

In the most general sense a moving average is defined as $Y_{t} = \sum_{k=0}^{\infty}\omega_{k}X_{t-k}$.

- Datum $X_{t-k}$ has age $k$ and weight $\omega_{k}$.

- For the weights to preserve scale, they must sum up to 1 i.e. $\sum_{k=0}^{\infty}\omega_{k} = 1$

An Exponentially Weighted Moving Average (EWMA) is a moving average where weights are exponentially decaying.

Let $\omega_{0}$ denote the initial weight. An exponentially decaying weighting function can be expressed with any of the following parameterisations \begin{equation} \omega_{k} = \begin{cases} \omega_{k-1}e^{-\lambda} = \omega_{0}e^{-\lambda k}, & \text{decay parameter } \lambda \geq 0 \\ \omega_{k-1}\left( 1/2 \right)^{\frac{1}{h}} = \omega_{0}\left(1/2\right)^{\frac{k}{h}}, & \text{half-life parameter } h \geq 0 \\ \omega_{k-1}(1-\alpha) = \omega_{0}(1-\alpha)^{k}, & \text{decay rate } \alpha \in (0,1) \end{cases} \end{equation} Renormalise the above so that the scale-preserving property is verified.

The third formulation with the decay rate $\alpha$ is equivalent to the often seen recursive formulation $$Y_t = \alpha X_t + (1-\alpha)Y_{t-1}$$

You can use any of the above representations to formulate an EWMA. For example, if we use the decay rate $\alpha$, the EWMA would be $$Y_t = \sum_{k=0}^{\infty}\alpha(1-\alpha)^{k}X_{t-k}$$

In practice, we do not have infinite past data when computing an EWMA. Supposing a lookback window of size $n$ (for example the 1-year window in your paper), the EWMA is $$Y_t = \frac{\sum_{k=0}^{n}(1-\alpha)^kX_{t-k}}{\sum_{k=0}^n(1-\alpha)^k}$$ This is by the way how the `ewm` function is implemented with pandas.

### half-life

The half-life of an exponential decay is the value in the domain at which the function reaches half if its initial value. It is an intuitive way to parameterise an EWMA because it is in the natural units of the process (e.g. in hours for hourly data).

You could specify for example the decay parameter $\lambda$ or the decay rate $\alpha$ directly in terms of the half-life by equating the following \begin{equation*} e^{-\lambda h} = \frac{1}{2}, \text{ i.e. } \lambda = \frac{\ln(2)}{h} \\ (1-\alpha)^h = \frac{1}{2}, \text{ i.e. } \alpha = 1 - e^{-\frac{\ln(2)}{h}} \end{equation*} You could also simply use the half-life formulation which I personally think is the most intuitive and the easiest.

### EWMA for volatility estimation

Volatility tends to cluster, i.e. periods of low volatility tend to follow periods of low volatility and vice versa. So the EWMA, which gives naturally more weight to recent data, lends itself well to the estimation of volatility.

In practice, the variance is estimated with the EWMA with any of the above representations with $Y_t = \sigma_t^2$ and $X_t = (r_t - r^*)^2$ where $r^*$ is the estimated mean return (for example using an EWMA).

How do we specify the half-life? Your paper indicates a 3-month half-life. As I said, the half-life must be in the natural units of the process being modelled (here it is the unit of the step $k$ in the summation). So we need to know the sampling frequency for the returns used here.

- In the case of daily returns ($\approx$ 252 trading days/year) then a 3-month half-life would be $h=\frac{252}{12}\times3 = 63 \text{ days}$

- In the case of monthly returns, then the half-life is simply $h=3$.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.