शुरू करेंमुफ़्त में शुरू करें

ACF प्लॉट

अगर कोई GARCH मॉडल अच्छा काम कर रहा है, तो उसकी standardized residuals में autocorrelations नहीं दिखनी चाहिए. इस अभ्यास में, आप ACF प्लॉट का उपयोग करके डेटा में autocorrelations पहचानने का अभ्यास करेंगे.

टाइम सीरीज़ में दो मानों के बीच सहसंबंध के गुणांक को autocorrelation function (ACF) कहा जाता है, और ACF प्लॉट अलग-अलग lags के बीच सहसंबंधों का दृश्य निरूपण है. Python के statsmodels पैकेज में प्री-डिफाइंड फंक्शंस उपलब्ध हैं जिनकी मदद से आप ACF प्लॉट आसानी से बना सकते हैं.

S&P 500 रिटर्न डेटा पर एक GARCH मॉडल फिट किया गया है, और उसकी standardized residuals निकालकर std_resid में सेव की गई हैं. matplotlib.pyplot को plt नाम से इम्पोर्ट किया गया है.

यह अभ्यास पाठ्यक्रम का हिस्सा है

Python में GARCH मॉडल

पाठ्यक्रम देखें

अभ्यास निर्देश

  • statsmodels पैकेज से ACF प्लॉट के लिए ज़रूरी मॉड्यूल इम्पोर्ट करें.
  • std_resid में सेव GARCH मॉडल की standardized residuals को प्लॉट करें.
  • standardized residuals का ACF प्लॉट जनरेट करें और कॉन्फिडेंस लेवल 0.05 पर सेट करें.

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Import the Python module
from statsmodels.graphics.tsaplots import ____

# Plot the standardized residuals
plt.plot(____)
plt.title('Standardized Residuals')
plt.show()

# Generate ACF plot of the standardized residuals
____(std_resid, ____ = ____)
plt.show()
कोड संपादित करें और चलाएँ