Econometric Modeler的ACF与我自己的ACF不匹配

时间:2018-07-27 19:34:20

标签: matlab correlation

我有一个令人费解的问题:

我有一个时间序列数据,我试图通过拟合gjr模型来进行iid。

首先,我尝试使用Econometric Modeler应用程序并为残留样品自相关函数获取以下图形:

<ACF%20from%20Econometric%20Modeler>

但是,当我尝试自行复制此图时,会得到完全不同的东西。为什么会这样?

  function GJR_Returns33 = modelTimeSeries(Returns)
  % GJR_Returns33 = modelTimeSeries(Returns)
  % returns an estimated model. This code recreates the estimated model
  % produced in the Econometric Modeler app. Use the code below to estimate
  % the same model, or estimate a model with the same parameters on a new set
  % of data.
  %
  % Input:
  %     Returns: A numeric matrix with the same number of columns as the data imported into the app
  %
  % Output:
  %     GJR_Returns33: The model containing estimated parameters
  %
  % Auto-generated by MATLAB Version 9.4 (R2018a) and Econometrics Toolbox Version 5.0 on 27-Jul-2018 21:05:12

  Returns3 = Returns(:,3);

  %% Estimate a GJR Model of time series Returns3
  GJR_Returns33 = gjr('Offset',NaN,'GARCHLags',1:2,'ARCHLags',1:2,'LeverageLags',1:2,'Distribution','t');
  GJR_Returns33 = estimate(GJR_Returns33,Returns3,'Display','off');
  [residuals2, variances2] = infer(GJR_Returns33, Returns3 );
      figure(1)
      autocorr(residuals2.^2)
      title('Sample ACF of Squared Standardized Residuals')
      figure(2)
      autocorr(residuals2)
      title('Sample ACF of Standardized Residuals')
  end

哪个给: enter image description here

我的代码有什么问题? 预先感谢

0 个答案:

没有答案