如何在SAS中获得ARIMA模型的MSE? [英] How to get MSE of ARIMA model in SAS?
问题描述
我正在比较两种模型,一种使用指数平滑,一种使用 ARIMA.
对于这个特定的任务,我比较两个模型的 MSE 就足够了.
那么我如何计算 ARIMA 过程的 MSE?
这是这门艰苦课程的最后一项作业,非常感谢您的帮助!
proc arima
不会专门输出 MSE,但 proc model
会.您可以使用 proc 模型
和 请注意,在进入 proc 模型
之前,必须在数据步骤中执行任何差分.
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!
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
.
这篇关于如何在SAS中获得ARIMA模型的MSE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!