Jinsi ya kukokotoa Moving Average
Moving Average ni nini?
A moving average smooths out short-term fluctuations in data by averaging values over a sliding window. Simple moving averages (SMA) and exponential moving averages (EMA) are core tools in financial analysis and signal processing.
Fomula
Simple MA_n = (x₁ + x₂ + ... + xₙ) / n; Exponential: EMA = α × xₜ + (1−α) × EMAₜ₋₁
- x₁, x₂, ..., xₙ
- data points
- n
- window size (period)
- α
- smoothing factor — for exponential moving average
- MA_n
- moving average
Mwongozo wa Hatua kwa Hatua
- 1SMA(n) = average of last n values
- 2EMA uses a weighting factor k = 2/(n+1)
- 3EMA(t) = value×k + EMA(t−1)×(1−k)
- 4EMA reacts faster to recent changes than SMA
Mifano Iliyotatuliwa
Ingizo
Data: 10,12,14,13,15, window=3
Matokeo
SMA: —,—,12,13,14
Ingizo
EMA-3 same data
Matokeo
Puts more weight on recent values
Maswali yanayoulizwa mara kwa mara
What is the difference between simple and exponential moving average?
SMA: all n values weighted equally. EMA: recent values weighted more heavily, responsive to changes.
How do I choose the window size n?
Larger n smooths more (less noise, less responsive). Smaller n is more responsive but noisier. Use domain knowledge.
Is moving average used for forecasting?
MA smooths historical data and can suggest trends, but it's backward-looking. ARIMA and other methods forecast better.
Je, uko tayari kukokotoa? Jaribu Kikokotoo kisicholipishwa cha Moving Average
Jaribu mwenyewe →