Skip to main content

Stock investing lessons

Learn at your own pace through 16 levels, from stock market basics to more advanced topics.

← Back to lessons
High school · Year 3

Pearson Correlation Coefficient

Stock prices rise and fall every day. Sometimes, two stocks go up at the same time. Other times, one goes up while the other goes down. But is there a way to measure how closely two stocks move together? One of the most common statistical measures used for this purpose is the Pearson correlation coefficient. It measures the strength and direction of the linear relationship between two sets of data. In investing, it is often used to examine how closely the returns of two assets move together. To understand the Pearson correlation coefficient, we first need to understand what a return is. Suppose a stock's price rises from $100 to $105. That's a return of +5%. If the price falls from $100 to $95 instead, the return is -5%. Expressing price changes as percentages makes it easier to compare stocks with different share prices. The Pearson correlation coefficient ranges from -1 to +1. A value close to +1 indicates a strong positive linear relationship, meaning the two sets of data tend to move in the same direction. A value close to -1 indicates a strong negative linear relationship, meaning they tend to move in opposite directions. A value close to 0 indicates a weak linear relationship. Let's look at an example. Suppose Company A's stock has returns of +2%, -1%, +3%, and -2% over four trading days. During the same period, Company B's stock has returns of +1%, -0.5%, +1.5%, and -1%. If we compare the two sets of returns, we can see that Company B's return is always exactly half of Company A's. When Company A's return increases, Company B's return increases proportionally. When Company A's return decreases, the same relationship holds. Because the two sets of returns follow a perfect positive linear relationship, their Pearson correlation coefficient is +1. Now suppose Company C has returns of -2%, +1%, -3%, and +2% over those same four days. Company C's returns are equal in magnitude to Company A's, but their signs are reversed. In this case, the two sets of returns have a perfect negative linear relationship, giving them a Pearson correlation coefficient of -1. In the real stock market, however, correlations of exactly +1 or -1 are rare. Even when two stocks generally move together, their returns don't usually change in perfectly consistent proportions. So what does a correlation coefficient of +0.8 tell us? It indicates a relatively strong positive linear relationship between the returns of two stocks. When one stock's return is higher, the other's tends to be higher as well. A coefficient of -0.8, on the other hand, indicates a strong negative linear relationship. Neither value means the stocks will follow that pattern every single day. If the correlation coefficient is close to 0, there is little evidence of a linear relationship between the two stocks' returns. However, that doesn't necessarily mean the stocks are completely unrelated. The Pearson correlation coefficient measures linear relationships, so it may not capture other patterns that exist in the data. How can investors use the Pearson correlation coefficient? One of its most important applications is diversification. Diversification means spreading money across different investments rather than putting everything into a single asset. The idea is to reduce the impact that a large loss in any one investment could have on the overall portfolio. For example, if two stocks are highly correlated, owning both may still leave an investor exposed to losses at roughly the same time. By contrast, combining assets with low correlations may help reduce fluctuations in the overall value of a portfolio because those assets don't always move together. Assets with negative correlations can be particularly useful because gains in one may help offset losses in another. Companies in similar industries are often influenced by the same economic factors. Semiconductor companies, for instance, may experience similar stock price movements when demand for chips rises or falls. Companies in different industries may respond to different economic forces and therefore have lower correlations. However, stocks in the same industry aren't necessarily highly correlated, just as stocks in different industries aren't necessarily weakly correlated. There is an important limitation to keep in mind. The Pearson correlation coefficient is calculated using historical data, and past relationships are not guaranteed to continue in the future. During a financial crisis, stocks that normally move independently may fall together as investors rush to sell risky assets. A low historical correlation, therefore, doesn't automatically make an investment safe. The result also depends on the period being analyzed. A correlation calculated using returns from the past month may be quite different from one calculated using data from the past five years. The result can also change depending on whether daily or monthly returns are used. Unusually large price movements on certain days can have a significant effect on the calculation as well. A high correlation doesn't mean a stock is a good investment, either. Correlation simply describes how two assets move in relation to each other. It doesn't tell us how much money they might earn or how financially sound the underlying companies are. Two stocks can have a high correlation even when their average returns are very different. It's also important to understand the difference between correlation and causation. Just because two stocks tend to rise and fall together doesn't mean that an increase in one company's stock price directly causes the other company's stock price to rise. Both stocks may simply be responding to the same economic conditions or overall market sentiment. Ultimately, the Pearson correlation coefficient helps investors understand whether the returns of two assets tend to move together or in opposite directions. By examining these relationships, investors can better assess how different investments might work together in a diversified portfolio. However, a single correlation coefficient cannot reveal every investment risk or predict future stock prices. What matters is understanding both what the number tells us and what it doesn't. The Pearson correlation coefficient isn't a formula for making the right investment decision. It's simply one of the tools investors can use to better understand how different assets behave in relation to one another.