Autocorrelation

Python में Time Series Analysis

Rob Reider

Adjunct Professor, NYU-Courant Consultant, Quantopian

Autocorrelation क्या है?

  • किसी टाइम सीरीज़ का अपने ही लैग्ड कॉपी से सहसम्बंध
  • इसे serial correlation भी कहते हैं
  • लैग-वन ऑटोकोरिलेशन
Python में Time Series Analysis

Autocorrelation की व्याख्या

  • Mean Reversion - नकारात्मक ऑटोकोरिलेशन
Python में Time Series Analysis

Autocorrelation की व्याख्या

  • Momentum या Trend Following - सकारात्मक ऑटोकोरिलेशन

Python में Time Series Analysis

ट्रेडर पैसा कमाने के लिए Autocorrelation का उपयोग करते हैं

  • व्यक्तिगत स्टॉक्स
    • ऐतिहासिक रूप से नकारात्मक ऑटोकोरिलेशन रहा है
    • छोटे अंतरालों (दिन) पर मापा जाता है
    • ट्रेडिंग रणनीति: हारने वालों को खरीदें, जीतने वालों को बेचें
  • कमोडिटी और करेंसीज़
    • ऐतिहासिक रूप से सकारात्मक ऑटोकोरिलेशन रहा है
    • लंबे अंतरालों (महीने) पर मापा जाता है
    • ट्रेडिंग रणनीति: जीतने वालों को खरीदें, हारने वालों को बेचें
Python में Time Series Analysis

सकारात्मक Autocorrelation का उदाहरण: एक्सचेंज रेट

  • DataFrame df में FRED से दैनिक $\yen$/$ एक्सचेंज रेट का उपयोग करें FRED
  • इंडेक्स को datetime में बदलें
# Convert index to datetime
df.index = pd.to_datetime(df.index)

# Downsample from daily to monthly data df = df.resample(rule='M').last()
# Compute returns from prices df['Return'] = df['Price'].pct_change()
# Compute autocorrelation autocorrelation = df['Return'].autocorr() print("The autocorrelation is: ",autocorrelation)
The autocorrelation is: 0.0567
Python में Time Series Analysis

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

Python में Time Series Analysis

Preparing Video For Download...