Skip to content

Commit

Permalink
Exponential Moving Average
Browse files Browse the repository at this point in the history
  • Loading branch information
ptyadana committed Jan 19, 2021
1 parent 5ecc760 commit 2dd6432
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/************ Exponential Moving Average **********/
/*
- A type of moving average
- wights decrease exponentially
- used to smooth trends when large variance in data
Smoothing Parameter
- typically 2 / (1+number of intervals)
- example, for 7 days of smoothing parameter is 0.25 (2/1+7)
- it is called lambda
Lambda Formula
- (current_period_value * lambda) + (previous_period_EWMA * (1-lambda))
- recursive
- could be calculated using Common Table Expression, but not recommended for large data sets.
- use User Defined function instead.
*/

0 comments on commit 2dd6432

Please sign in to comment.