Analýza časových řad v Pythonu
Rob Reider
Adjunct Professor, NYU-Courant Consultant, Quantopian


Korelace = 0,9

Korelace = -0,9

Korelace = 0,4

Korelace = 1,0

Dow Jones Industrial Average a pozorování UFO (www.nuforc.org)

Korelace úrovní: 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
Analýza časových řad v Pythonu