1
$\begingroup$

X<- c(3,6,8,10,6,5) If I want to forecast using 3point moving average I use ma(X,3) from forecast package So this is going to give a series of smoothed average. If I want to forecast further 2 points ahead I used forecast (ma(X,3),h=2) So this forecast function doesn't use moving average method to forecast further points Rather it automatically chooses the eye model and forecasts the 2 points further. So my confusion is how do I forecast using 3 point moving average method only, as the forecast function uses ets?

$\endgroup$
2
  • 1
    $\begingroup$ Do you want a moving average model (a special case of ARMA model) or a rolling average (an average estimated in a rolling window)? $\endgroup$ Commented Dec 21, 2019 at 16:20
  • $\begingroup$ Rolling average in 3 sliding window, I'm talking about $\endgroup$
    – Manisha
    Commented Dec 21, 2019 at 16:21

2 Answers 2

1
$\begingroup$

Moving average does not have the "forecast" functionality, because this is a method for smoothing the time-series, not forecasting. If you wanted to use it for forecasting, the only way that would make sense would be to use as a forecast the mean of the last three points and repeat the value as many times as you want for the forecast window. Beyond the last three points, you have nothing to smooth, and all the following values would average over the same points so they won't change. This is called the "naive". Repeating the last value is called the naïve (or random walk) forecasting method.

Given how small your dataset is, you are rather limited to simple forecasting methods. Using something like the naïve forecast, predicting the mean of the whole dataset, or mean of the last three values is probably not that a bad idea if you have good reason to believe that more recent values tell you more about the future than the rest of the time-series. The mean of the whole dataset (6.33) or of the last three values (7.0) and intervals from such forecasts would be strongly overlapping given the size of the data. If you looked at the 80% prediction interval for the mean forecast, you would be forecasting that the future would be not smaller than the smallest value in the data and not larger than the largest value (2.47-10.19).

Notice that the moving average is not the same as moving average model (see ), which can be used for forecasting.

$\endgroup$
0
$\begingroup$

I took your "toy example" of 6 values ...enter image description here and executed AUTOBOX ( a forecasting package that I have helped to develop ) and instructed the software to lock in a 3 period weighted average WITH equal coefficients and obtained

enter image description here and enter image description here

Following is the Actual/Fit and Forecast for 6 periodsenter image description here

Here are the 6 period out forecasts ....enter image description here using monte-carlo bootstrapping rather than presumptive normality for the residuals.

$\endgroup$
3
  • $\begingroup$ Thanks so much. $\endgroup$
    – Manisha
    Commented Dec 22, 2019 at 2:35
  • 1
    $\begingroup$ The question asked about moving average smoothing, not the moving average model. Your answer misses the point, or at least does not state explicitly that what you show refers to using a different method than mentioned by OP. $\endgroup$
    – Tim
    Commented Dec 30, 2021 at 23:24
  • $\begingroup$ If you us a two period moving average , you are essentially converting an observed series of N observations to a new series that contains N-1 "observations" or values. If you use a 3 period centered filter then you lose 2 values , one at each end. Assumed conversion strategies inject autocorrelation which are then empirically identifiable via the acf/pacf. $\endgroup$
    – IrishStat
    Commented Jan 4, 2022 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.