matlab预测ARMA-GARCH 条件均值和方差模型

此示例显示MATLAB如何从复合条件均值和方差模型预测 和条件差异。

步骤1加载数据并拟合模型 

加载工具箱附带的纳斯达克数据。将条件均值和方差模型拟合到数据中。

  1.  
     
  2.  
    nasdaq = DataTable.NASDAQ;
  3.  
    r = price2ret(nasdaq);
  4.  
    N = length(r);
  5.  
     
  6.  
    model = arima( 'ARLa gs' 1,'Variance',garch(1,1),...
  7.  
    'Distrib ution','t');
  8.  
    fit = estimate(mode ,r, 'Variance0',{'Constant0',0.001});
  9.  
     
  10.  
    ARIMA( 1,0,0) Model (t Distribution):
  11.  
     
  12.  
    Value StandardError TStatistic PValue
  13.  
    _________ _____________ __________ __________
  14.  
     
  15.  
    Constant 0.0012326 0.00018163 6.786 1.1528e-11
  16.  
    AR{ 1} 0.066389 0.021398 3.1026 0.0019182
  17.  
    DoF 14.839 2.2588 6.5693 5.0539e-11
  18.  
     
  19.  
     
  20.  
     
  21.  
    GARCH( 1,1) Conditional Variance Model (t Distribution):
  22.  
     
  23.  
    Value StandardError TStatistic PValue
  24.  
    __________ _____________ __________ __________
  25.  
     
  26.  
    Constant 3.4488e-06 8.3938e-07 4.1087 3.9788e-05
  27.  
    GARCH{1} 0.82904 0.015535 53.365 0
  28.  
    ARCH{ 1} 0.16048 0.016331 9.8268 8.6333e-23
  29.  
    DoF 14.839 2.2588 6.5693 5.0539e-11
  30.  
    [E0,V0] = infer(fit,r);

第2步预测收益和条件差异 

使用forecast计算回报状语从句:条件方差为1000周期的未来视界的MMSE预测。使用观察到的回报和推断残差以及条件方差作为预采样数据。

  1.  
    [Y,YMS E,V] = forecast(fit, 100 0,'Y 0',r,'E0', E0, 'V0' ,V0);
  2.  
    upper = Y + 1.96*sqrt(YMSE);
  3.  
    lower = Y - 1.96*sqrt(YMSE);
  4.  
     
  5.  
    figure
  6.  
    subplot(2,1,1)
  7.  
    plot(r,'Color',[.75,.75,.75])
  8.  
    hold on
  9.  
    plot(N+1:N+1000,Y,'r','LineWidth',2)
  10.  
    plot(N+1:N+1000,[upper,lower],'k--','LineWidth',1.5)
  11.  
    xlim([0,N+1000])
  12.  
    title('Forecasted Returns')
  13.  
    hold off
  14.  
    subplot(2,1,2)
  15.  
    plot(V0,'Color',[.75,.75,.75])
  16.  
    hold on
  17.  
    plot(N+1:N+1000,V,'r','LineWidth',2);
  18.  
    xlim([ 0,N+1000])
  19.  
    title( 'Forecasted Conditional Variances')
  20.  
    hold off

条件方差预测收敛于GARCH条件方差模型的渐近方差。预测的收益收敛于估计的模型常数(AR条件均值模型的无条件均值)。

转载于:https://www.cnblogs.com/tecdat/p/9373539.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值