Main Content

使用计量器建模器应用程序选择GARCH模型的拱门滞后

此示例显示了如何使用计量经济学建模器应用程序为GARCH模型选择适当数量的ARCH和GARCH滞后。数据集存储在data_markpound多伊奇,包含日常mark/British pound bilateral spot exchange rates from 1984 through 1991.

将数据进口到计量经济学建模者

在命令行,加载data_markpound。mat数据集。

加载data_markpound

At the command line, open the计量经济学建模者应用程序。

econometricModeler

或者,从应用程序画廊打开应用程序(请参阅计量经济学建模者)。

进口Data至the app:

  1. 计量经济学建模者tab, in the进口部分,单击

  2. In the导入数据对话框,在进口?column, select the check box for theData多变的。

  3. 点击进口

The variable数据1出现在Time Seriespane, and its time series plot appears in the时间序列图(数据1)图形窗口。

汇率看起来是非平稳的(似乎在固定水平上没有波动)。

转换数据

Convert the exchange rates to returns.

  1. 数据1selected in theTime Seriespane, on the计量经济学建模者tab, in theTransforms部分,单击日志

    In theTime Seriespane, a variable representing the logged exchange rates (data1log)出现,其时间序列图出现在Time Series Plot(Data1Log)图形窗口。

  2. In theTime Series窗格,选择data1log

  3. 计量经济学建模者tab, in theTransforms部分,单击区别

In theTime Seriespane, a variable representing the returns (data1logDiff出现。差异系列的时间序列图出现在时间序列图(data1logdiff)图形窗口。

检查自相关

In theTime Series窗格,重命名data1logDiffvariable by clicking it twice to select its name and enteringReturns

该应用更新与退货关联的所有文档的名称。

返回系列围绕公共水平波动,但表现出波动性聚类。回报的巨大变化往往聚集在一起,而小的变化往往会聚集在一起。也就是说,该系列表现出条件异方差。

视觉上通过绘制样本ACF和PACF来评估收益是否具有串行相关性:

  1. Close all figure windows in the right pane.

  2. In theTime Series窗格,选择Returns时间序列。

  3. 点击the情节tab, then clickACF

  4. 点击the情节tab, then clickPACF

  5. 拖动PACF(返回)figure window below theACF(Returns)图形窗口,以便您可以同时查看它们。

样品ACF和PACF几乎没有显着的自相关。

Conduct the Ljung-Box Q-test to assess whether there is significant serial correlation in the returns for at most 5, 10, and 15 lags. To maintain a false-discovery rate of approximately 0.05, specify a significance level of 0.05/3 = 0.0167 for each test.

  1. 关上ACF(Returns)andPACF(返回)图窗。

  2. Returnsselected in theTime Seriespane, on the计量经济学建模者tab, in the测试部分,单击New Test>Ljung-Box Q-Test

  3. LBQtab, in the参数section, setNumber of Lags5

  4. 显着性水平0.0167

  5. In the测试部分,单击Run Test

  6. Repeat steps 3 through 5 twice, with these changes.

    1. Number of Lags至10 and thedof到10。

    2. Number of Lags至15and thedof至15。

The test results appear in theResultsLBQ(Returns)文档。

The Ljung-Box Q-test null hypothesis that all autocorrelations up to the tested lags are zero is not rejected for tests at lags 5, 10, and 15. These results, and the ACF and PACF, suggest that a conditional mean model is not needed for this returns series.

Check for Conditional Heteroscedasticity

To check the returns for conditional heteroscedasticity,计量经济学建模者需要一系列平方残差。将平方残差导入应用程序后,通过绘制平方残差的ACF和PACF来视觉上评估是否存在条件异质性。然后,通过进行Engle的拱门测试来确定回报型的适当数量的滞后。

通过贬低回报,然后将结果的每个元素平方来计算命令行处的一系列平方残差。

ExportReturns至the command line:

  1. In theTime Seriespane, right-clickReturns

  2. 在上下文菜单中,选择Export

Returns出现在MATLAB®Workspace.

从申报表中删除平均值,然后将结果的每个元素保持平衡。确保所有系列Time Seriespane are synchronized, Econometric Modeler prepends first-differenced series with a价值。因此,为了估计样本平均值,请使用mean(Returns,'omitnan')

残差=返回 - 均值(返回,'omitnan');残差2 =残差。^2;

创建一个包含Returnsand残差2变量。

Tbl = table(Returns,Residuals,Residuals2);

进口Tblinto Econometric Modeler:

  1. 计量经济学建模者tab, in the进口部分,单击

  2. 该应用必须在导入新数据之前清除正确的窗格和所有文档。因此,单击后进口, in the计量经济学建模者dialog box, clickOK

  3. In the导入数据对话框,在进口?column, select the check box for theTbl多变的。

  4. 点击进口

变量出现在Time Seriespane, and a time series plot of all the series appears in the时间序列图(残差)图形窗口。

绘制平方残差的ACF和PACF。

  1. 关上时间序列图(残差)图形窗口。

  2. In theTime Series窗格,选择残差2时间序列。

  3. 点击the情节tab, then clickACF

  4. 点击the情节tab, then clickPACF

  5. 拖动PACF(残留2)figure window below theACF(Residuals2)图形窗口,以便您可以同时查看它们。

The sample ACF and PACF of the squared returns show significant autocorrelation. This result suggests that a GARCH model with lagged variances and lagged squared innovations might be appropriate for modeling the returns.

进行Engle在残留系列中的拱门测试。指定两个lag拱模型的替代假设。

  1. 关闭所有图形窗口。

  2. In theTime Series窗格,选择Residuals时间序列。

  3. 计量经济学建模者tab, in the测试部分,单击New Test>Engle's ARCH Test

  4. tab, in the参数section, setNumber of Lags2

  5. In the测试部分,单击Run Test

The test results appear in theResults拱门(残差)文档。

恩格尔(Engle)的拱门测试拒绝了无拱门效应的无效假设,而有利于另外两个滞后的平方创新的替代拱形模型。具有两个滞后创新的拱形模型在本地等同于GARCH(1,1)模型。

Create and Fit GARCH Model

Fit a GARCH(1,1) model to the returns series.

  1. In theTime Series窗格,选择Returns时间序列。

  2. 点击the计量经济学建模者tab. Then, in theModels部分,单击the arrow to display the models gallery.

  3. In the models gallery, in theGarchModels部分,单击Garch

  4. In theGARCH模型参数对话框,在Lag Ordertab:

    1. Garch学位1

    2. 拱门学位1

    3. Because the returns required demeaning, include an offset by selecting the包括偏移复选框。

  5. 点击估计

模型变量Garch_Returns出现在Models窗格,其价值出现在Previewpane, and its estimation summary appears in the模型摘要(GARCH_RETURNS)文档。

An alternative way to select lags for a GARCH model is by fitting several models containing different lag polynomial degrees. Then, choose the model yielding the minimal AIC.

也可以看看

应用

对象

功能

Related Topics