preloader
image

Corre- lation Analysis

NIFTY50 52 week Correlation Analysis

The study presented in this project is a stock and sector wise correlation analysis of NIFTY50 over a period of 52 weeks. I usually update this every year.

Important Note!

  1. The stock data used in this study is obtained using free data source. As such the stock prices are not adjusted for stock splits and dividends. This will result in incorrect results. If adjusted closed prices are obtained, the same pipeline presented below can be used with correct data.

  2. For pairs trading, we need co-integration, not correlation.

Common Mistakes with Correlation

The single most common mistake is assuming a correlation approaching +/- 1 is statistically significant. A reading approaching +/- 1 definitely increases the chances of actual statistical significance, but without further testing it’s impossible to know. The statistical testing of a correlation can get complicated for a number of reasons; it’s not at all straightforward. A critical assumption of correlation is that the variables are independent and that the relationship between them is linear. In theory, you would test these claims to determine if a correlation calculation is appropriate.

The second most common mistake is forgetting to normalize the data into a common unit. If calculating a correlation on two betas, then the units are already normalized: beta itself is the unit. However, if you want to correlate stocks, it’s critical you normalize them into percent return, and not share price changes. This happens all too frequently, even among investment professionals.

For stock price correlation, you are essentially asking two questions: What is the return over a certain number of periods, and how does that return correlate to another security’s return over the same period? This is also why correlating stock prices is difficult: Two securities might have a high correlation if the return is daily percent changes over the past 52 weeks, but a low correlation if the return is monthly changes over the past 52 weeks. Which one is “better”? There really is no perfect answer, and it depends on the purpose of the test.

Source

Furtner Reading

Why Correlation Doesn’t Matter Much