Python으로 배우는 시계열 분석
Rob Reider
Adjunct Professor, NYU-Courant Consultant, Quantopian


상관계수 = 0.9

상관계수 = -0.9

상관계수 = 0.4

상관계수 = 1.0

다우존스 산업평균지수와 UFO 목격 건수 (www.nuforc.org)

수준값 상관계수: 0.94
df['SPX_Ret'] = df['SPX_Prices'].pct_change()
df['R2000_Ret'] = df['R2000_Prices'].pct_change()
plt.scatter(df['SPX_Ret'], df['R2000_Ret'])
plt.show()

correlation = df['SPX_Ret'].corr(df['R2000_Ret'])
print("Correlation is: ", correlation)
Correlation is: 0.868
Python으로 배우는 시계열 분석