问题
I am comparing two models, one with exponential smoothing and one with ARIMA.
For this specific assignment, it's enough that I compare the MSE of the two models.
So how do I compute the MSE of the ARIMA procedure?
This is the last assignment on this grueling course, help would be greatly appreciated!
回答1:
proc arima
does not specifically output the MSE, but proc model
does. You can recreate the ARIMA model using proc model
and the %AR and %MA macros.
proc model data=have;
endo y;
id date;
y = mu;
%AR(AR, 1, y, m=ML);
%MA(MA, 1, y, m=ML);
fit y;
run;
This specifies an ML-estimated ARMA(1,0,1) model with an intercept, mu
.
proc model
will then output the MSE of your model. Note that %MA
must come after %AR
, and both the %AR
and %MA
macros must come after the equation.
If you need a more complicated lag structure, you can specify additional options in either macro:
%AR(AR, 3, y, 1 3, M=ML)
This creates ML-estimated AR variables of order 3 whose variable prefix is AR
using a subset of lags 1 and 3.
Here is an example of output using sashelp.air
with the %AR
macro:
Note that any differencing must be performed in a data step before entering proc model
.
来源:https://stackoverflow.com/questions/34991749/how-to-get-mse-of-arima-model-in-sas