Skip to content
All library documents

Matching EWMA Half-Life to a Simple Moving Average Span

Article Quant Q&A · Author: The User

Summary

The document explains one way to compare an exponentially weighted moving average (EWMA) with an N-period simple moving average (SMA): match their center of mass, or the average age of the observations contributing to each estimate. Under this criterion, the EWMA decay parameter is 2 divided by N plus 1. Converting that decay parameter to a half-life gives an exact expression for the matched EWMA half-life.

For larger spans, the relationship is approximately that the SMA span is about 2.89 times the EWMA half-life. The discussion therefore supports the rough rule that a 10-period SMA corresponds to an EWMA half-life near one third of the span. It also describes an alternative smoothing-parameter relation based on equating weighted observation age. The comparison is criterion-dependent: there is no universal exact equivalence between SMA and EWMA, and matching average age does not make their weighting schemes identical.

Key ideas

  • Matching the averages’ center of mass provides a practical way to relate SMA span to EWMA decay.
  • For an SMA span N, the corresponding EWMA decay parameter is 2 divided by N plus 1 under this criterion.
  • The matched EWMA half-life is approximately the SMA span divided by 2.89 for sufficiently large spans.
  • The relationship is an approximation in use and does not make the two averaging methods identical.

Tags

Full text
# Equivalence of Exponentially Weighted Moving Average to Simple Moving Average


# Equivalence of Exponentially Weighted Moving Average to Simple Moving Average












I am aware of the differences between an Exponentially Weighted Moving Average (EWMA) and a Simple Moving Average (SMA), with the weights of the latter being fixed and equal for each observation in the calculation compared to exponentially decaying weights for the former.

Is there a rule of thumb to relate the lookback-period / formation-period of a SMA to the half-life of an EWMA? In other words, if I am working with a SMA of, say, 10 days, is there an approximate of the half-life of an equivalent EWMA?

A former colleague told me once that a SMA is approximately equivalent to about 3x the half-life of an EWMA but I do not recall why. He claims that e.g., if you're using a SMA of 10 days, the equivalent EWMA will have a half-life of 3.3 days. Does anyone have an analytical solution to the equivalence?

## Answer by mark leeds (score 3)

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

Hi: I haven't heard of that equivalence. But one other equivalence which you may be interested in is the $\rho = 2/(N+1)$ relation where $N$ is the width of the moving average and $\rho$ is the parameter of the SES model: $\hat{y}_t = \rho \hat{y}_{t-1} + (1-\rho)y_{t}$.

The derivation of above is in Brown's book: "Smoothing, Forecasting and Prediction of Discrete Time Series". IIRC, he equates the weighted age of the observations in the moving average with that of the SES.

This is not to say that your colleague is incorrect. It might be something he-she came up with on their own. So, this is not an answer to your question but it was too long for a comment.

The half-life $h$ in an SES model is obtained by setting $\rho^{h} = \frac{1}{2}$. This can be re-written so that one gets $h = \frac{log(1/2)}{log(\rho)}$. In this manner, one can obtain the half-life given the SES parameter, $\rho$.

## Answer by Michael Isichenko (score 1)

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

There is no (and cannot be) any exact relationship between simple moving average (SMA) and exponential moving average (EMA). Qualitatively, they are similar for similar trailing horizons. I would argue in favor of EMA for most (or all) applications as much much more computationally efficient and API-friendly. I am not aware of a single case, in my ML/forecasting experience at least, where SMA is superior to EMA in some respects. But I would also recommend against the simple EMA update formula as used in the previous answer. Instead, a simple data structure maintaining the weighted sum of observed values, their squares, and the weights themselves supports an efficient computation of mean, standard deviation, effective number of weighted observations, and other statistics. An EMA horizon is introduced by a decaying all sums by a factor less than one. A similar data structure for multivariate observations supports EMA correlations, OLS, ridge, Lasso, and other linear models.

## Answer by wissam124 (score 0)

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

An EWMA can be said to be comparable to a $N$-period SMA when both averages have the same center of mass $\text{COM}$, i.e. when they use data of the same "average age".

Think of the center of mass as the average age of the information making up the moving average. To make the analogy with physics, imagine it as the physical balance point of a timeline where each of your data point is weighted. It is where your moving average is anchored.

For a $N$-period SMA, the center of mass is $\text{COM} = \frac{N-1}{2}$. For an EWMA parameterised with a decay rate $\alpha$, the center of mass is $\text{COM} = \frac{1-\alpha}{\alpha}$.

I provide more details on the above here.

If we equate the $\text{COM}$ of an EWMA parameterised with a decay rate $\alpha$ to that of a $N$-period SMA, we have $\alpha = \frac{2}{N+1}$. This is by the way how you would parameterise $\alpha$ using the `span` parameter in pandas implementation of the `ewm` function. So, essentially, you can parameterise an EWMA by specifying a span parameter $N$ such that the resulting EWMA has the same center of mass as a $N$-period SMA.

The half-life for an EWMA parameterised with the decay rate $\alpha$ is $h = - \frac{\ln(2)}{\ln(1-\alpha)} = - \frac{1}{\log_2(1-\alpha)}$. Therefore the half-life of an EWMA that has the same center of mass as a $N$-period SMA is $$h = -\frac{1}{\log_2{\frac{N-1}{N+1}}}$$

As a first order approximation for $N$ sufficiently large, this gives $h \approx \frac{\ln(2)}{2}N$ or $N\approx\frac{2}{\ln(2)}h$. We have $\frac{2}{\ln{2}} \approx 2.89$. Your colleague rule of thumb of saying the span of an EWMA is about three times its half-life is correct. In my opinion, it is a lot more intuitive to think about this the other way around and say that the half-life of an EWMA with a span $N$ is about a third of the span.

This is how for example you could say that the half-life of an EWMA of span 10 (i.e. anchored at the same center of mass as a 10-day SMA) is c. 3.45 (or 3.3 like your colleague says if you do an even coarser approximation by dividing by 3 instead of 2.89).

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.