0
$\begingroup$

enter image description here

The above chart plots a 300 weekly exponential average. With 52 weeks per year, the indicator would start calculating the EMAVG after 5.77 years, in 2016.

What technique could it be using to be able to calculate EMAVG values for the weeks before 2016?

note: that is a bitcoin price chart, there is no data before 2010

$\endgroup$
7
  • $\begingroup$ Is this really an Exponentially Weighted Moving Average or an ordinary moving average of 300 weeks ? $\endgroup$
    – noob2
    Feb 22 at 23:12
  • 1
    $\begingroup$ Yeah, exponential. Pretty sure that is a bloomberg terminal screen and it is using EMAVG. Source: twitter.com/RaoulGMI/status/1363910890924441605 $\endgroup$
    – givanse
    Feb 22 at 23:56
  • $\begingroup$ It''s probably starting at 2005 or whatever is needed for the exponential smoothed series to begin at 2010 and change or wherever it's actually beginning. $\endgroup$
    – mark leeds
    Feb 23 at 6:32
  • $\begingroup$ That is a bitcoin price chart, there is no data before 2010. Should have mentioned before, sorry. $\endgroup$
    – givanse
    Feb 23 at 22:08
  • 1
    $\begingroup$ Hi: In that case, it's probably doing what kermittfrog explained. Note that his formula puts $(1-\lambda)$ on the previous estimate and $\lambda$ on the current value. You need to flip it, if bloomberg does the opposite thing. $\endgroup$
    – mark leeds
    Feb 23 at 23:48
1
$\begingroup$

The exponential weighting scheme yields an estimate $Z_t$ from observations $X_t$

$$ Z_t=\sum_{k=0}^{\infty} w_k X_{t-k} $$

where the (infinite) series of weights sums to one, i.e. $\sum_{k=0}^{\infty} w_k=1$.

Let's call the exponential weighting parameter $\lambda$. For a 'lookback window' of length $N$ elements, this results in a weight for the elements $k=0,1,\ldots,N$ of

$$ w_N(k)=\lambda^k\frac{1-\lambda}{1-\lambda^{N+1}} $$

So for the first $M<N$ elements, you would simply calculate the EWMA using a smaller data window, increasing until sufficient length $N$, and then simply roll with the $w_N(k)$ weights.

HTH?

$\endgroup$
1
$\begingroup$

The initial price values on the chart are close to the EMA values which suggests that the EMA was calculated over an 'incomplete' window.

The EMA function is unbounded and is calculated recursively over all preceding values. It doesn't require a minimum number of samples to be present. But it needs a smoothing parameter α in the range [0, 1] to deflate far-away samples. The parameter is non-intuitive and is often substituted with the N parameter (number of periods) which relates to α as α = 2/(N+1). For instance, EMA(N=300) is converted to EMA(α=0.00664) behind the scenes.

Another explanation is that the EMA was calculated over raw data prior to 2010 and this raw data is not displayed.

The screenshot below shows weekly crude oil prices from FRED. Raw prices are in blue.

The top chart shows EMA functions with various N parameters applied to time series starting with January 2010. The bottom chart shows the same EMA functions calculated from 2000 onward. Notice how EMA(300) shows different values on January 2010.

ema

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.