enescingoz / bist_stocks_correlation

Python script to calculate correlation between +400 BIST stocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BIST Stocks Correlation

Analyze financial data correlations

About Correlation

  • In statistics, correlation or dependence is any statistical relationship, whether causal or not, between two random variables or bivariate data. Although in the broadest sense, "correlation" may indicate any type of association, in statistics it usually refers to the degree to which a pair of variables are linearly related. Familiar examples of dependent phenomena include the correlation between the height of parents and their offspring, and the correlation between the price of a good and the quantity the consumers are willing to purchase, as it is depicted in the so-called demand curve.

  • Correlations are useful because they can indicate a predictive relationship that can be exploited in practice. For example, an electrical utility may produce less power on a mild day based on the correlation between electricity demand and weather. In this example, there is a causal relationship, because extreme weather causes people to use more electricity for heating or cooling. However, in general, the presence of a correlation is not sufficient to infer the presence of a causal relationship (i.e., correlation does not imply causation).

Source: Wikipedia

Features

  • You can run it fast, and it is easy to use.
  • There are no complexities and no database usage in this project. Even dependencies are a few.
  • It is easy to modify and customize.
  • This project generates practical information for data scientists.
  • You can read the code for educational purposes.

Sample Correlation Matrix Output

TODO

Run

  1. Clone the repository.
  2. Run pip3 install -r requirements.txt.
  3. Run python3 main.py.

This will print the correlation matrix, most correlated pairs and save it to a CSV file.

Config

For the configuration, you can change config.py constants.

Config.py Description

TODO

See Also

Credits

Erfan Alimohammadi and Amir Reza Shahmiri

About

Python script to calculate correlation between +400 BIST stocks


Languages

Language:Python 100.0%