開始使用免費開始

用對數概似挑選最佳模型

在這個練習中,你會練習用對數概似(log-likelihood)來挑選擬合度最佳的模型。

GARCH 模型以極大概似法估計參數。一般來說,對數概似越大,模型越好,因為這代表在該模型下觀察到手上資料的機率越高。

已針對 S&P 500 報酬率資料定義並擬合兩個具不同分配假設的 GARCH 模型。常態分配的 GARCH 結果存於 normal_result,偏斜 Student's t 分配的 GARCH 結果存於 skewt_result

本練習屬於課程

Python 中的 GARCH 模型

檢視課程

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Print normal GARCH model summary
print(____.____())
# Print skewed GARCH model summary
print(____.____())

# Print the log-likelihood of normal GARCH
print('Log-likelihood of normal GARCH :', ____.____)
# Print the log-likelihood of skewt GARCH
print('Log-likelihood of skewt GARCH :', ____.____)
編輯並執行程式碼