자기상관

Python으로 배우는 시계열 분석

Rob Reider

Adjunct Professor, NYU-Courant Consultant, Quantopian

자기상관이란?

  • 시계열과 그 지연 복사본 간의 상관관계
  • 직렬 상관이라고도 함
  • 1차 지연 자기상관
Python으로 배우는 시계열 분석

자기상관의 해석

  • 평균 회귀 - 음의 자기상관
Python으로 배우는 시계열 분석

자기상관의 해석

  • 모멘텀 또는 추세 추종 - 양의 자기상관

Python으로 배우는 시계열 분석

트레이더들이 자기상관을 활용하는 방법

  • 개별 주식
    • 역사적으로 음의 자기상관을 보임
    • 단기 기간(일 단위)으로 측정
    • 거래 전략: 손실 종목 매수, 수익 종목 매도
  • 원자재 및 통화
    • 역사적으로 양의 자기상관을 보임
    • 장기 기간(월 단위)으로 측정
    • 거래 전략: 수익 종목 매수, 손실 종목 매도
Python으로 배우는 시계열 분석

양의 자기상관 예시: 환율

  • FRED의 DataFrame df에 일별 $\yen$/$ 환율 데이터 사용
  • 인덱스를 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으로 배우는 시계열 분석

연습해 봅시다!

Python으로 배우는 시계열 분석

Preparing Video For Download...