You have 3 free guides left 😟
Unlock your guides
You have 3 free guides left 😟
Unlock your guides

5.1 Simple and weighted moving averages

2 min readjuly 22, 2024

Moving averages are powerful tools for smoothing out short-term fluctuations in time series data. They help reveal underlying trends by averaging past observations, with simple moving averages using equal weights and weighted moving averages assigning more importance to recent data.

While moving averages are easy to understand and implement, they have limitations. They lag behind current data and may miss sudden changes. Choosing the right order is crucial, considering factors like , noise level, and trend stability to balance smoothing effectiveness with .

Moving Averages

Simple moving averages calculation

Top images from around the web for Simple moving averages calculation
Top images from around the web for Simple moving averages calculation
  • Smooths out short-term fluctuations in time series data by taking the average of a fixed number of past observations (window size or order)
  • Formula for calculating the of order kk at time tt: SMAt=1ki=0k1ytiSMA_t = \frac{1}{k} \sum_{i=0}^{k-1} y_{t-i}
    • ytiy_{t-i} represents the observed value at time tit-i
  • Example: Calculating a 3-period simple moving average
    • Given observations: y1=10y_1 = 10, y2=12y_2 = 12, y3=8y_3 = 8, y4=14y_4 = 14
    • SMA3=13(10+12+8)=10SMA_3 = \frac{1}{3} (10 + 12 + 8) = 10
    • SMA4=13(12+8+14)=11.33SMA_4 = \frac{1}{3} (12 + 8 + 14) = 11.33

Weighted moving averages computation

  • Assigns different weights to past observations, giving more importance to recent observations and less to older ones
  • The sum of all weights should equal 1
  • Formula for calculating the of order kk at time tt: WMAt=i=0k1wiytiWMA_t = \sum_{i=0}^{k-1} w_i y_{t-i}
    • wiw_i represents the weight assigned to the observation at time tit-i
  • Example: Calculating a 3-period weighted moving average with weights w0=0.5w_0 = 0.5, w1=0.3w_1 = 0.3, w2=0.2w_2 = 0.2
    • Given observations: y1=10y_1 = 10, y2=12y_2 = 12, y3=8y_3 = 8, y4=14y_4 = 14
    • WMA3=0.5(8)+0.3(12)+0.2(10)=9.6WMA_3 = 0.5(8) + 0.3(12) + 0.2(10) = 9.6
    • WMA4=0.5(14)+0.3(8)+0.2(12)=11.8WMA_4 = 0.5(14) + 0.3(8) + 0.2(12) = 11.8

Advantages vs limitations of moving averages

  • Advantages
    • Simple to understand and implement
    • Smooths out short-term fluctuations and reveals underlying trends
    • Helps identify trend direction and potential trend reversals (bullish or bearish)
  • Limitations
    • relying on past observations
    • May miss sudden changes or shifts in the time series (outliers or structural breaks)
    • Sensitive to the choice of order or window size
    • Does not account for seasonality or other complex patterns (cyclical or irregular components)

Order selection for moving averages

  • Depends on data characteristics and analysis purpose
  • Factors to consider
    1. Seasonality: Order should be a multiple of the seasonal period (monthly or quarterly data)
    2. Noise level: Higher noise requires larger orders for effective smoothing
    3. Trend stability: Stable trends allow for larger orders to capture long-term patterns
    4. Responsiveness: Smaller orders are more responsive to recent changes but may not smooth out noise effectively
  • Experimentation and validation
    • Compare results from different orders to find the most suitable one
    • Use cross-validation to assess performance and select the best order (in-sample and out-of-sample testing)
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.
Glossary
Glossary