# Best way to calculate correlation of stock price movements

I'm looking at correlations between stock price movements.

Most recommendations are to use Pearson correlation which, iiuc, requires normality, but then they proceed to use to actual prices for the period in question and calculate differences wrt the average price.

I can though imagine scenarios where the average price is perhaps not a good measure of the price over the period. Does this not make the actual price compared to the average a questionable metric to use, and perhaps not normal?

If so, would not the percentage price movement [1] each day (or other period) be a more accurate input to calculate correlation?

[1] Or maybe the log? I see this being referred to as more normal, though I admit I really don't understand the reasons.

• Don't use correlation for time-series kdnuggets.com/2018/06/…
– Tim
Dec 4, 2021 at 21:08
• @Tim Thanks for that. I can see it makes so sense to compare DJIA with website clicks, but if I want to understand, for example, how correlated SPX and BTC prices are, what are the alternatives? Correlation testing for portfolios is a standard tool, no?
– Ian
Dec 4, 2021 at 21:25

It's well known that prices are not normally distributed. Thus, I would first transform prices into either "simple returns" defined as $$r_t = (P_t - P_{t-1})/P_{t-1}$$ or "log-returns", defined as $$r_t = \log(P_t) - \log(P_{t-1})$$, where $$t$$ is the time of the price, like day, week, month, minute, etc.

Then run correlation between the different assets.

Correlation is used very often in quantitative finance, as is covariance -- as long as the denominating currency is the same for all the assets. Correlation and auto-correlation change with time as well, and this refers to the stationarity vs non-stationarity of a times-series. There are also seasonality issues, among other characteristics which are addressed.

• Many thanks for this, makes sense to me. I've looked the normal distributions for both the "simple" and "log" returns and, for a sample for 5000 results from the s&p500 dailies they both give almost identical results from the shapiro test (W=0.849xx, p-value < 2.2e-16), which, iiuc, means that these are very non-normal as well, and using log10 rather simple makes no difference. A QQplot shows a reasonable straight trend line from about -1.5% to +1.5% but then substantial deviation. How serious a problem is this in practice for correlation?
– Ian
Dec 6, 2021 at 2:52
• I should have added that a histogram shows that the majority of the data seems to be within that +/- 1.5% range.
– Ian
Dec 6, 2021 at 3:02
• Most daily simple returns or log-returns follow a logistic distribution, followed by Cauchy, and then - maybe - normal. But normal is rare, it's usually logistic then Cauchy.
– user318288
Dec 6, 2021 at 3:41