# Correlation

Correlation is a unitless measure, from −1 to +1, of how closely two variables move together in a linear relationship.

## What it means

When comparing stocks, correlation describes the extent to which their returns have moved together over a chosen period. A value near +1 means their returns tended to rise and fall together; near −1 means they tended to move in opposite directions. Near zero means little *linear* relationship, not necessarily no relationship at all.

Correlation has no units. Its value depends on the returns used, their frequency and the observation window. For example, a correlation calculated from daily returns over one year can differ from one calculated from monthly returns over five years. Historical correlation does not establish what will happen next.

## How it is calculated

Pearson correlation compares the covariance of two return series with their individual standard deviations:

`r_AB = Σ[(A_i − Ā)(B_i − B̄)] / √{Σ(A_i − Ā)² × Σ(B_i − B̄)²}`

- `r_AB` is the correlation coefficient for stocks A and B, between −1 and +1.
- `A_i` and `B_i` are the two stocks’ returns in the same period `i`, expressed consistently as percentages or decimals.
- `Ā` and `B̄` are their respective average returns across the observations.
- `Σ` means add the indicated values across all matched periods.

Use returns rather than raw share prices: two prices can trend upward together even when their period-by-period returns have little relationship. If either return series has zero variation, its standard deviation is zero and this correlation is undefined. For a basket, correlations between pairs of holdings can be combined with position weights and volatilities to estimate portfolio volatility; correlation alone does not give that volatility.

## Worked example

Consider two hypothetical stocks with returns measured in percentage points over four matched periods:

| Period | Stock A | Stock B |
| --- | ---: | ---: |
| 1 | +1% | +2% |
| 2 | +2% | +4% |
| 3 | −1% | −2% |
| 4 | −2% | −4% |

1. Average each series. Both averages are 0%.
2. Multiply each pair of deviations from its average: `1 × 2 + 2 × 4 + (−1) × (−2) + (−2) × (−4) = 20` squared percentage points.
3. Sum the squared deviations for A: `1 + 4 + 1 + 4 = 10`. For B: `4 + 16 + 4 + 16 = 40`.
4. Divide: `r_AB = 20 / √(10 × 40) = 20 / 20 = +1`.

B’s returns are exactly twice A’s in this artificial example, so their correlation is perfectly positive. That does not mean they have equal volatility: B’s return changes are twice as large.

## Why it matters before you trade

Adding a stock to a basket does not necessarily add much diversification. If its returns closely follow those of existing holdings, the basket may remain exposed to similar movements. Conversely, a lower historical correlation can help explain why holdings sometimes offset one another, without guaranteeing protection during a downturn.

Before placing a trade, a correlation check is most useful alongside position weights, individual volatility, sector exposures and the time period examined. Correlations can change, particularly when market conditions change. A stock can also have a low correlation with another stock while both remain exposed to a broad market decline.

## How PreTrAIde uses it

PreTrAIde’s stated quantitative layer does not list a pairwise correlation calculation. Its pre-trade analysis instead checks a proposed stock basket using measures including daily volatility, 1-day 95% value at risk, portfolio breakdowns by sector, country, region, currency and market capitalization, and a Herfindahl-Hirschman concentration index. These checks provide context for basket risk, but concentration by holdings or categories is not the same measure as return correlation. PreTrAIde’s GO, NO-GO and MODIFY verdicts are decision support, not investment recommendations.

## Common mistakes

- **Treating +1 as equal risk:** Stocks can move in lockstep but have different-sized returns, as in the example.
- **Treating zero as independence:** Zero correlation rules out a linear relationship in the measured sample, not every possible relationship.
- **Mixing periods or data types:** Compare returns from matched dates and the same frequency, using consistent treatment of dividends and corporate actions.
- **Assuming a fixed number:** A historical estimate can shift with the observation window or future market conditions.
- **Confusing correlation with concentration:** Equal sector labels do not prove high correlation, and different labels do not prove low correlation.

---
Source: https://pretraide.com/glossary/correlation
