การตรวจสอบข้อสมมติของโมเดล GARCH

GARCH Models ใน Python

Chelsea Yang

Data Science Instructor

การตรวจสอบด้วยภาพ

ข้อมูล return ดิบ

ค่าคงเหลือมาตรฐาน

GARCH Models ใน Python

Autocorrelation

  • อธิบายความสัมพันธ์ของตัวแปรกับตัวเองที่ค่า time lag ต่าง ๆ

  • หากพบ autocorrelation ในค่าคงเหลือมาตรฐาน แสดงว่าโมเดลอาจไม่ถูกต้อง

วิธีตรวจจับ autocorrelation:

  • ACF plot
  • Ljung-Box
GARCH Models ใน Python

ACF plot

  • ACF: AutoCorrelation Function
  • ACF Plot: แสดง autocorrelation ในแต่ละ lag ด้วยภาพ

ACF plot

พื้นที่สีแดงในกราฟแสดงระดับความเชื่อมั่น (alpha = 5%)

GARCH Models ใน Python

ACF plot ใน Python

from statsmodels.graphics.tsaplots import plot_acf

plot_acf(my_data, alpha = 0.05)
GARCH Models ใน Python

การทดสอบ Ljung-Box

  • ทดสอบว่า autocorrelation ในกลุ่มค่าใด ๆ ของอนุกรมเวลาแตกต่างจากศูนย์หรือไม่
  • H0: ข้อมูลมีการกระจายแบบอิสระ
  • P-value < 5%: โมเดลไม่ถูกต้อง
GARCH Models ใน Python

Ljung-Box test ใน Python

# Import the Python module
from statsmodels.stats.diagnostic import acorr_ljungbox
# Perform the Ljung-Box test
lb_test = acorr_ljungbox(std_resid , lags = 10)
# Check p-values
print('P-values are: ', lb_test[1])
GARCH Models ใน Python

มาฝึกกันเถอะ!

GARCH Models ใน Python

Preparing Video For Download...