1. Estimation and Forecasting an MA Model
The same module that you used to estimate the parameters of
2. Estimating an MA Model
The same module that you used to estimate the parameters of an AR model can be used to estimate the parameters of an MA model. Import the class ARIMA as before, and create an instance of that class called mod, with the arguments being the data that you're trying to fit, and the order of the model. However, now the order is (0,0,1), for an MA(1), not (1,0,0) as it was for an AR(1).
And as before with an AR model, once you instantiate the class, you can then use the method fit to estimate the model, and store the results in result.
3. Forecasting an MA Model
The procedure for forecasting an MA model is the same as that for an AR model: you have to import the statsmodels function plot_predict. The first argument in the plot_predict function is the result from the fitted model. You also give plot_predict the starting and ending data points for forecasting. And you set ax equal to ax so that the data and the predictions are on the same axes.
One thing to note, is that with an MA(1) model, unlike an AR model, all forecasts beyond the one-step ahead forecast will be the same.
4. Let's practice!
Time to put this into practice.