Skip to main content
aifinhub
Risk & Portfolio Construction Formula

Correlation Formula

The Pearson correlation coefficient is the covariance between two return series divided by the product of their standard deviations. It rescales covariance to a fixed range from -1 to +1, so two assets can be compared regardless of their volatility. Correlation is the central input to diversification: combining assets with low or negative correlation reduces portfolio risk.

By AI Fin Hub Research · AI Fin Hub Team
Best Next MoveCalculators

Correlation Matrix Visualizer

Paste a multi-asset returns CSV. See the Pearson correlation heatmap, condition number, average absolute correlation, and eigenvalue concentration.

CalculatorOpen ->

On This Page

Formula

Copy the exact expression or work through it step by step below.

rho(x,y) = Cov(x,y) / (sigma_x x sigma_y) Cov(x,y) = (1/(n-1)) x sum_i (x_i - mean_x)(y_i - mean_y)

Variables

Cov(x,y)

Covariance

Average product of the two series' deviations from their respective means. Its sign tells the direction of co-movement, but its magnitude depends on the assets' volatilities, which is why it must be normalized.

sigma_x, sigma_y

Standard deviations

Standard deviations of each series. Dividing covariance by their product strips out the scale, leaving a pure measure of linear association.

rho(x,y)

Correlation coefficient

Bounded between -1 (perfect inverse) and +1 (perfect direct), with 0 meaning no linear relationship. It measures only linear dependence, so nonlinear relationships can show low correlation despite strong structure.

n

Number of observations

Count of paired return periods. The n-1 divisor in the sample covariance gives an unbiased estimate.

Step By Step

  1. 1

    Compute the mean of each return series.

    Asset X mean 0.8%, asset Y mean 0.5% over the sample.

  2. 2

    For each period multiply the two deviations from their means, sum, and divide by n-1 to get the covariance.

    The sample covariance works out to 0.00018.

  3. 3

    Compute each series' standard deviation.

    sigma_X = 2.0%, sigma_Y = 1.5%.

  4. 4

    Divide the covariance by the product of the two standard deviations.

    0.00018 / (0.020 x 0.015) = 0.00018 / 0.0003 = 0.60.

Worked Example

Correlation between two assets being considered for a pair

Covariance(X, Y)

0.00018

sigma_X

2.0%

sigma_Y

1.5%

Denominator = sigma_X x sigma_Y = 0.020 x 0.015 = 0.00030. Correlation = 0.00018 / 0.00030 = 0.60.

Correlation of +0.60. The two assets move together more often than not but are far from lockstep, leaving meaningful diversification benefit when combined. Note correlation captures only linear co-movement and is notoriously unstable in crises, when correlations across risk assets tend to spike toward 1 just when diversification is needed most.

Common Variations

Spearman rank correlation: correlates the ranks rather than the values, robust to outliers and capturing monotonic non-linear relationships.
Rolling correlation: estimated over a moving window to reveal how the relationship changes through time and regimes.
Partial correlation: measures the association between two series after removing the influence of a third, isolating direct linkage.

Try These Tools

Run the numbers next

Sources & References

Related Content

Keep the topic connected

Planning estimates only — not financial, tax, or investment advice.