Python 中的 GARCH 模型
Chelsea Yang
Data Science Instructor
財務建模的精彩之處: 預測未知

滾動視窗預測: 隨著時間推進,重複配適模型並進行預測

持續將新資料點加入樣本

擴張視窗預測:
for i in range(120):
gm_result = basic_gm.fit(first_obs = start_loc,
last_obs = i + end_loc, disp = 'off')
temp_result = gm_result.forecast(horizon = 1).variance
加入新資料點,同時移除舊資料點

固定滾動視窗預測:
for i in range(120):
# Specify rolling window range for model fitting
gm_result = basic_gm.fit(first_obs = i + start_loc,
last_obs = i + end_loc, disp = 'off')
temp_result = gm_result.forecast(horizon = 1).variance
通常需視情況決定
視窗太大:納入過時資料,可能提高變異數
視窗太小:排除相關資料,可能提高偏誤
最佳視窗大小:在偏誤與變異數間取捨

Python 中的 GARCH 模型