From the course: Advanced SQL for Data Science: Time Series
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Exponential moving average - SQL Tutorial
From the course: Advanced SQL for Data Science: Time Series
Exponential moving average
- [Instructor] Another type of moving average you may encounter is called exponential moving average. Now, the exponential moving average is, as the name implies, a type of a moving average calculation. In this case, the weights decrease exponentially, and this is often used to smooth out trends when there's large variance in data, so essentially it reduces the impact of noise in your signal. Now, the formula consists of a couple of pieces. One is a smoothing parameter. This smoothing parameter is typically two divided by the number of intervals that we're working with. So for example, if we want to smooth over a period of seven days, the value would be two divided by one plus seven or eight, so two divided by eight is 0.25. Now that smoothing parameter is called lambda. Now we can go on and complete the formula. An exponential weighted average is basically whatever the value is at the current period times the lambda, plus the previous period's exponential weighted moving average…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Common Table Expressions and recursion2m 46s
-
(Locked)
Calculating aggregates over windows1m 34s
-
(Locked)
Previous day comparison3m 50s
-
(Locked)
Moving averages1m 59s
-
(Locked)
Weighted moving averages5m 18s
-
(Locked)
Forecasting with linear regression3m 39s
-
(Locked)
Exponential moving average1m 29s
-
(Locked)
-