AR मॉडल का आकलन और पूर्वानुमान

Python में Time Series Analysis

Rob Reider

Adjunct Professor, NYU-Courant Consultant, Quantopian

AR मॉडल का आकलन

  • डेटा (simulated) से पैरामीटर का आकलन करने के लिए

    from statsmodels.tsa.arima_model import ARMA
    mod = ARMA(data, order=(1,0))
    result = mod.fit()
    
  • ARMA अब deprecated है, इसकी जगह ARIMA है

    from statsmodels.tsa.arima.model import ARIMA
    mod = ARIMA(data, order=(1,0,0))
    result = mod.fit()
    
  • ARMA के लिए, order=(p,q)

  • ARIMA के लिए, order=(p,d,q)
Python में Time Series Analysis

AR मॉडल का आकलन

  • पूरा आउटपुट (सही $\large \mu=0$ और $\large \phi=0.9$)
    print(result.summary())
    

Python में Time Series Analysis

AR मॉडल का आकलन

  • केवल $\large \mu$ और $\large \phi$ के estimates (सही $\large \mu=0$ और $\large \phi=0.9$)
    print(result.params)
    
array([-0.03605989,  0.90535667])
Python में Time Series Analysis

AR मॉडल से पूर्वानुमान

from statsmodels.graphics.tsaplots import plot_predict
fig, ax = plt.subplots()
data.plot(ax=ax)
plot_predict(result, start='2012-09-27', end='2012-10-06', alpha=0.05, ax=ax)
plt.show()
  • फंक्शन plot_predict() के arguments
    • पहला argument fitted मॉडल है
    • बिना confidence interval के लिए alpha=None सेट करें
    • डेटा और prediction एक ही axes पर दिखाने के लिए ax=ax सेट करें

Python में Time Series Analysis

अभ्यास करते हैं!

Python में Time Series Analysis

Preparing Video For Download...