-1
$\begingroup$

I'am trying to define an exponential moving average function denoted $EMA_{\alpha}(x_{n})$ where $\alpha$ is the smoothing coefficient and $x_{n}$ is the input signal. My first approach was to use the following notation:

$$ EMA_{\alpha}(x_{n}) = y_{n} = \alpha x_{n} + (1 - \alpha)y_{n-1} $$

But i don't know if its correct to use it. I have seen somewhere the following one:

$$ EMA_{n}^{\alpha}(x_{n}) = \alpha x_{n} + (1 - \alpha)EMA_{n-1} $$

But i don't know if this one is also appropriate.

$\endgroup$
3
  • $\begingroup$ May I ask why the notation is important? $\endgroup$ – DSP Novice Mar 20 '20 at 2:16
  • $\begingroup$ Hi: As the other responder mentioned, It doesn't really matter but, to me, if you take off the $\alpha$ in the superscript on the LHS of the second equation, then it's "more correct" than the first equation because there really isn't a $y_n$ when you're doing exponential smoothing. There's the exponential smoothing estimate and the thing you're smoothing, which, in your case, I think is $x_n$. $\endgroup$ – mark leeds Mar 20 '20 at 3:37
  • $\begingroup$ Note that there shouldn't be an $(x_{n})$ on the left hand side of the second equation either. Just leave it as $EMA_{n}$. $\endgroup$ – mark leeds Mar 20 '20 at 3:38
2
$\begingroup$

Good Gosh! Why on Earth would you be so complicated as to use that $EMA_{\alpha}(x_{n})$ notation? Are you trying to be clever, or maybe sophisticated? You're mixing letters and variables in the same notation. Is $EMA_{\alpha}(x_{n})$ supposed to be a word (or maybe a variable), or what? Adding to the confusion is: if subscripting 'n' indicates sample indexing then what the heck is meant by subscripting $\alpha$? Don't be clever, ...you'll just confuse your readers. For the sake of your readers I suggest you avoid using that $EMA_{\alpha}(x_{n})$ notation altogether.

$\endgroup$
6
  • $\begingroup$ Thanks for your answer and recommendation. I understand what you are saying and agree with the subscript problem, i just wanted to use this notation because i have seen it on some articles, and could allow to apply an exponential moving average twice, that is $EMA_{\alpha}(EMA_{\alpha}(x_{n}))$, instead of using a longer formulation such as : $a_{n} = \alpha x_{n} + (1-\alpha)a_{n-1}$ $b_{n} = \alpha a_{n} + (1-\alpha)b_{n-1}$ But i understand that i might have been trying to hard to make things more convenient for me, i will follow your advice. I apologize. $\endgroup$ – alexgrover Mar 21 '20 at 17:59
  • $\begingroup$ @Wolt. Please forgive me if I sounded too harsh in my answer. $\endgroup$ – Richard Lyons Mar 22 '20 at 3:14
  • $\begingroup$ No worries, based on the question rating i think i may have not have shared enough context, but your answer helped me, as i now understand that using subscripts that can both represent sample indexing and a function argument can indeed be pretty confusing. So thank you for your time and answer. $\endgroup$ – alexgrover Mar 22 '20 at 22:48
  • 1
    $\begingroup$ @Wolf. Hi. I was thinking. You might eliminate the word "moving" and use the notation $EA(x_{n},\alpha)$, which you could define to your readers as meaning "an exponential averaging operation performed on the $x_n$ sequence using a smoothing coefficient of $\alpha$". $\endgroup$ – Richard Lyons Mar 23 '20 at 3:27
  • $\begingroup$ Thank you for your answer, this notation is indeed less confusing and work perfectly for me! Can't thank you enough, as using my first notation could have indeed resulted in terrible consequences for the reader. Thanks a lot for your time :) $\endgroup$ – alexgrover Mar 23 '20 at 17:13

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.