Skip to content

Commit 2dd6432

Browse files
committed
Exponential Moving Average
1 parent 5ecc760 commit 2dd6432

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/************ Exponential Moving Average **********/
2+
/*
3+
- A type of moving average
4+
- wights decrease exponentially
5+
- used to smooth trends when large variance in data
6+
7+
8+
Smoothing Parameter
9+
- typically 2 / (1+number of intervals)
10+
- example, for 7 days of smoothing parameter is 0.25 (2/1+7)
11+
- it is called lambda
12+
13+
14+
Lambda Formula
15+
- (current_period_value * lambda) + (previous_period_EWMA * (1-lambda))
16+
- recursive
17+
- could be calculated using Common Table Expression, but not recommended for large data sets.
18+
- use User Defined function instead.
19+
20+
*/

0 commit comments

Comments
 (0)