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

गरम होने से पहले: Autocorrelations पर नज़र डालें

क्योंकि तापमान की सीरीज़ temp_NY एक ड्रिफ्ट वाली रैंडम वॉक है, इसे stationary बनाने के लिए फर्स्ट डिफरेंस लें। फिर सैंपल ACF और PACF निकालें। इससे मॉडल के ऑर्डर के बारे में दिशा-निर्देश मिलेगा.

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

Python में Time Series Analysis

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

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

  • सैंपल ACF और PACF प्लॉट करने के लिए ज़रूरी मॉड्यूल इम्पोर्ट करें
  • pandas की .diff() मेथड का उपयोग करके DataFrame temp_NY के फर्स्ट डिफरेंस लें
  • ACF और PACF प्लॉट करने के लिए दो सबप्लॉट बनाएँ
    • डिफरेंस की गई सीरीज़ का सैंपल ACF प्लॉट करें
    • डिफरेंस की गई सीरीज़ का सैंपल PACF प्लॉट करें

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

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

# Import the modules for plotting the sample ACF and PACF
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf

# Take first difference of the temperature Series
chg_temp = ___.___
chg_temp = chg_temp.dropna()

# Plot the ACF and PACF on the same page
fig, axes = plt.subplots(2,1)

# Plot the ACF
plot_acf(___, lags=20, ax=axes[0])

# Plot the PACF
plot_pacf(___, lags=20, ax=axes[1])
plt.show()
कोड संपादित करें और चलाएँ