Python 中的 GARCH 模型
Chelsea Yang
Data Science Instructor


描述變數在滯後 {{1}} 下與自身的相關性
標準化殘差若存在自我相關,表示模型可能不穩健
檢測自我相關:

圖中的紅色區域表示信賴水準(alpha = 5%)
from statsmodels.graphics.tsaplots import plot_acf
plot_acf(my_data, alpha = 0.05)
# 匯入 Python 模組
from statsmodels.stats.diagnostic import acorr_ljungbox
# 執行 Ljung-Box 檢定
lb_test = acorr_ljungbox(std_resid , lags = 10)
# 檢查 p 值
print('P-values are: ', lb_test[1])
Python 中的 GARCH 模型