拓端tecdat|matlab預(yù)測ARMA-GARCH 條件均值和方差模型
?全文鏈接:?tecdat.cn/?p=2841
原文出處:拓端數(shù)據(jù)部落公眾號
相關(guān)視頻:時間序列分析:ARIMA GARCH模型分析股票價格數(shù)據(jù)
時間序列分析模型 ARIMA-ARCH GARCH模型分析股票價格數(shù)據(jù)
此示例顯示MATLAB如何從條件均值和方差模型預(yù)測。
步驟1加載數(shù)據(jù)并擬合模型
加載工具箱附帶的納斯達(dá)克數(shù)據(jù)。將條件均值和方差模型擬合到數(shù)據(jù)中。
?nasdaq = DataTable.NASDAQ; r = price2ret(nasdaq); N = length(r); fit = estimate(mode ,r,'Variance0',{'Constant0',0.001}); ? ? ? ARIMA(1,0,0) Model (t Distribution): ? ? ? ? ? ? ? ? ? ? Value ? ? ?StandardError ? ?TStatistic ? ? ?PValue ? ? ? ? ? ? ? ? ? _________ ? ?_____________ ? ?__________ ? ?__________ ? ? Constant ? ?0.0012326 ? ? 0.00018163 ? ? ? ? 6.786 ? ? ?1.1528e-11 ? ? AR{1} ? ? ? ?0.066389 ? ? ? 0.021398 ? ? ? ?3.1026 ? ? ? 0.0019182 ? ? DoF ? ? ? ? ? ?14.839 ? ? ? ? 2.2588 ? ? ? ?6.5693 ? ? ?5.0539e-11 ? ? ? ? GARCH(1,1) Conditional Variance Model (t Distribution): ? ? ? ? ? ? ? ? ? ? Value ? ? ? StandardError ? ?TStatistic ? ? ?PValue ? ? ? ? ? ? ? ? ? __________ ? ?_____________ ? ?__________ ? ?__________ ? ? Constant ? ?3.4488e-06 ? ? 8.3938e-07 ? ? ? ?4.1087 ? ? ?3.9788e-05 ? ? GARCH{1} ? ? ? 0.82904 ? ? ? 0.015535 ? ? ? ?53.365 ? ? ? ? ? ? ? 0 ? ? ARCH{1} ? ? ? ?0.16048 ? ? ? 0.016331 ? ? ? ?9.8268 ? ? ?8.6333e-23 ? ? DoF ? ? ? ? ? ? 14.839 ? ? ? ? 2.2588 ? ? ? ?6.5693 ? ? ?5.0539e-11 [E0,V0] = infer(fit,r); 復(fù)制代碼
第2步預(yù)測收益和條件差異
使用forecast
計算收益率:條件方差為1000周期的未來數(shù)據(jù)的MMSE預(yù)測。使用觀察到的收益率和推斷殘差以及條件方差作為預(yù)采樣數(shù)據(jù)。
[Y,YMS E,V] = forecast(fit, 100 0,'Y 0',r,'E0', E0, 'V0' ,V0); upper = Y + 1.96*sqrt(YMSE); lower = Y - 1.96*sqrt(YMSE); figure subplot(2,1,1) plot(r,'Color',[.75,.75,.75]) hold on 復(fù)制代碼
編輯
條件方差預(yù)測收斂于GARCH條件方差模型的漸近方差。預(yù)測的收益收斂于估計的模型常數(shù)(AR條件均值模型的無條件均值)。