此示例显示了如何使用计量经济学建模器应用程序使用ARMA错误指定和估计回归模型。数据集存储在Data_USEconModel.mat
,包含每季度测量的美国个人消费支出,以及其他系列。
Consider modeling the US personal consumption expenditures (PCEC
, in $ billions) as a linear function of the effective federal funds rate (FEDFUNDS
), unemployment rate (不合理
)和真正的国内生产总值(GDP
, in $ billions with respect to the year 2000).
At the command line, load theData_USEconModel.mat
data set.
loadData_USEconModel
Convert the federal funds and unemployment rates from percents to decimals.
DataTable.UNRATE = 0.01*DataTable.UNRATE; DataTable.FEDFUNDS = 0.01*DataTable.FEDFUNDS;
将名义GDP to real GDP by dividing all values by the GDP deflator (GDPDEF
)并将结果缩放100。创建一个列DataTable
for the real GDP series.
DataTable.RealGDP = 100*DataTable.GDP./DataTable.GDPDEF;
在命令行,打开Econometric Modeler应用程序。
计量经济学
Alternatively, open the app from the apps gallery (seeEconometric Modeler).
ImportDataTable
进入应用程序:
On theEconometric Modeler标签,在Importsection, click。
在里面Import Datadialog box, in theImport?列,选择的复选框DataTable
variable.
ClickImport。
全部time series variables inDataTable
出现在时间序列pane, and a time series plot of the series appears in the时间序列图(COE)figure window.
绘制PCEC
,RealGDP
,FEDFUNDS
, 和不合理
series on separate plots.
在里面时间序列pane, double-clickPCEC
。
重复步骤1RealGDP
,FEDFUNDS
, 和不合理
。
在里面right pane, drag the时间序列Plot(PCEC)顶部的图形窗口使其占据前两个象限。
Drag the时间序列图(RealGDP)第一个象限的图形窗口。
Drag the时间序列Plot(UNRATE)第三象限的图形窗口。
ThePCEC
和RealGDP
series appear to have an exponential trend. The不合理
和FEDFUNDS
series appear to have a stochastic trend.
右键单击任何图形窗口的选项卡,然后选择关闭所有关闭所有图形窗口。
通过执行Belsley共线性诊断,检查该系列是否是共线。
在里面时间序列pane, selectPCEC
。然后,按Ctrl然后单击以选择RealGDP
,FEDFUNDS
, 和不合理
。
On theEconometric Modeler标签,在Testssection, click新测试>Belsley Collinearity Diagnostics。
The Belsley collinearity diagnostics results appear in theCollinearity(FEDFUNDS)document.
全部condition indices are below the default condition-index tolerance, which is 30. The time series do not appear to be collinear.
Specify a linear model in whichPCEC
是回应和RealGDP
,FEDFUNDS
, 和不合理
是预测指标。
在里面时间序列pane, selectPCEC
。
点击Econometric Modeler标签。然后,在楷模部分,单击箭头以显示模型库。
在模型画廊中,在Regression Modelssection, clickMLR。
在里面MLR Model Parametersdialog box, in the预测指标section, select the包括?复选框FEDFUNDS
,RealGDP
, 和不合理
time series.
ClickEstimate。
The model variablemlr_pcec
appears in the楷模pane, its value appears in the预习窗格及其估计摘要出现在Model Summary(MLR_PCEC)document.
在里面Model Summary(MLR_PCEC)图窗口,残差图表明,违反了不相关错误的标准线性模型假设。残留物似乎是自相关,非平稳性和可能异质的。
To stabilize the residuals, stabilize the response and predictor series by converting thePCEC
和RealGDP
prices to returns, and by applying the first difference toFEDFUNDS
和不合理
。
ConvertPCEC
和RealGDP
回报的价格:
在里面时间序列pane, select thePCEC
时间序列,然后按Ctrl并选择RealGDP
time series.
On theEconometric Modeler标签,在变换section, clickLog, then clickDiff。
在里面时间序列pane, variables representing the logged and differenced time series appear.
在里面时间序列pane, rename thePCECLogDiff
和RealGDPLogDiff
。点击PCECLogDiff
variable twice to select its name and enterpcecreturns
。点击RealGDPLogDiff
variable twice to select its name and enterRealgdpreturns
。
将第一个区别应用于FEDFUNDS
和不合理
:
在里面时间序列pane, select theFEDFUNDS
时间序列,然后按Ctrl并选择不合理
time series.
On theEconometric Modeler标签,在变换section, clickDifference。
在里面时间序列pane, variables representing the first difference of the time series appear.
关闭所有图形窗口和文档。
Respecify the linear model, but use the stabilized series instead.
在里面时间序列pane, selectpcecreturns
。
On theEconometric Modeler标签,在楷模部分,单击箭头以显示模型库。
在模型画廊中,在Regression Modelssection, clickMLR。
在里面MLR Model Parametersdialog box, in the预测指标section, select the包括?复选框FEDFUNDSDiff
,Realgdpreturns
, 和未注重的人
time series.
ClickEstimate。
The model variableMLR_PCECRETURNS
appears in the楷模pane, its value appears in the预习窗格及其估计摘要出现在模型摘要(MLR_PCECRETURNS)document.
残留图表明残留物是自相关的。
Assess whether the residuals are normally distributed and autocorrelated by generating quantile-quantile and ACF plots.
创建一个分位数量式图MLR_PCECRETURNS
model residuals:
在里面时间序列pane, select theMLR_PCECRETURNS
model.
On theEconometric Modeler标签,在Diagnosticssection, clickResidual Diagnostics>Residual Q-Q Plot。
残差向右偏斜。
绘制残差的ACF:
在里面时间序列pane, select theMLR_PCECRETURNS
model.
On theEconometric Modeler标签,在Diagnosticssection, clickResidual Diagnostics>Autocorrelation Function。
On theACFtab, setNumber of Lagsto40
。
The plot shows autocorrelation in the first 34 lags.
尝试通过指定ARMA(1,1)错误的回归模型来纠正残差中的自相关pcecreturns
。
在里面时间序列pane, selectpcecreturns
。
点击Econometric Modeler标签。然后,在楷模部分,单击箭头以显示模型库。
在模型画廊中,在Regression Modelssection, clickRegARMA。
在里面regARMA Model Parametersdialog box:
在里面滞后订单标签:
Set自回归订单to1
。
Set移动平均订单to1
。
在里面预测指标section, select the包括?复选框FEDFUNDSDiff
,Realgdpreturns
, 和未注重的人
time series.
ClickEstimate。
The model variableRegARMA_PCECReturns
appears in the楷模pane, its value appears in the预习窗格及其估计摘要出现在Model Summary(RegARMA_PCECReturns)document.
Thetstatistics suggest that all coefficients are significant, except for the coefficient of未注重的人
。The residuals appear to fluctuate aroundy= 0无自相关。
评估是否存在RegARMA_PCECReturns
model are normally distributed and autocorrelated by generating quantile-quantile and ACF plots.
创建一个分位数量式图RegARMA_PCECReturns
model residuals:
在里面楷模pane, select theRegARMA_PCECReturns
model.
On theEconometric Modeler标签,在Diagnosticssection, clickResidual Diagnostics>Residual Q-Q Plot。
The residuals appear approximately normally distributed.
绘制残差的ACF:
在里面楷模pane, select theRegARMA_PCECReturns
model.
On theEconometric Modeler标签,在Diagnosticssection, clickResidual Diagnostics>Autocorrelation Function。
The first autocorrelation lag is significant.
从这里开始,您可以估计多个模型,这些模型会因ARMA误差模型中自回归和移动平均多项式订单的数量而异。然后,选择具有最低拟合统计量的模型。或者,您可以通过将预测与样本外数据进行比较来检查模型的预测性能。