Tutorials › Exam P - Probability › Perfect Correlation and Equality Cases

Exam P · Covariance and Correlation · Tutorial 760 of 915

Perfect Correlation and Equality Cases

Use an almost-sure affine relationship to recognize and verify perfect positive or negative correlation, while checking the required variance conditions.

Intermediate 12 min read

What You'll Learn

  • State the conditions under which correlation is defined.
  • Translate correlation of 1 or −1 into a relationship between centered variables.
  • Derive the equality condition using standardized variables and a squared difference.
  • Verify perfect correlation by checking an affine relationship and its slope.
  • Recognize why an affine relationship need not mean the variables are equal.
  • Distinguish perfect correlation from a nonlinear relationship that does not attain either bound.

Introduction

Correlation is bounded between −1 and 1, but the endpoints have a precise meaning: they describe an exact straight-line relationship between two random variables. For an actuarial exam problem, the important check is not whether the variables seem to move together, but whether one is an affine function of the other with probability 1.

This equality condition is useful both ways. If the relationship is given, it can establish the correlation immediately. If the correlation is known to be 1 or −1, it identifies the relationship that must hold. The condition also prevents a common misinterpretation: perfect correlation does not generally mean that the variables have the same values.

Definition: Suppose \(X\) and \(Y\) have finite, strictly positive variances. Their correlation is $$ \rho_{X,Y}=\frac{\operatorname{Cov}(X,Y)} {\sqrt{\operatorname{Var}(X)}\sqrt{\operatorname{Var}(Y)}}. $$ The condition \(\operatorname{Var}(X)>0\) and \(\operatorname{Var}(Y)>0\) is necessary: if either variable is constant with probability 1, its standard deviation is zero and the correlation is undefined.

The Equality Condition

Let \(\sigma_X=\sqrt{\operatorname{Var}(X)}\) and \(\sigma_Y=\sqrt{\operatorname{Var}(Y)}\). Standardize each variable by subtracting its mean and dividing by its standard deviation: \(U=(X-E[X])/\sigma_X\) and \(V=(Y-E[Y])/\sigma_Y\). Both standardized variables have mean 0 and variance 1. Their correlation is \(\rho_{X,Y}=E[UV]\).

Theorem: If \(X\) and \(Y\) have finite, strictly positive variances, then:
  • \(\rho_{X,Y}=1\) if and only if \(Y-E[Y]=c(X-E[X])\) almost surely for some \(c>0\).
  • \(\rho_{X,Y}=-1\) if and only if \(Y-E[Y]=c(X-E[X])\) almost surely for some \(c<0\).
Equivalently, either endpoint holds exactly when \(Y=a+bX\) almost surely for constants \(a\) and \(b\ne 0\); the sign of \(b\) gives the sign of the correlation.

Here, “almost surely” means that the relationship holds with probability 1. It may fail on outcomes that have probability zero, but it must hold on every outcome that has positive probability in a discrete model. The slope \(c\) in the centered relationship is the same as the slope \(b\) in the affine relationship, and \(c=b\).

Why the Equality Condition Holds

The key observation is that a squared difference cannot be negative. For standardized \(U\) and \(V\), expand the expected squared difference:

$$ E[(U-V)^2] =E[U^2]+E[V^2]-2E[UV] =1+1-2\rho_{X,Y} =2(1-\rho_{X,Y}). $$

If \(\rho_{X,Y}=1\), this expectation is zero. A nonnegative random variable with expectation zero must equal zero almost surely, so \(U-V=0\) almost surely. Thus \(U=V\), which gives \(Y-E[Y]=(\sigma_Y/\sigma_X)(X-E[X])\). The slope is positive because both standard deviations are positive. Conversely, if this centered relationship holds with a positive slope, the standardized variables are equal almost surely, so their correlation is 1.

For the negative endpoint, use the sum instead:

$$ E[(U+V)^2] =E[U^2]+E[V^2]+2E[UV] =2(1+\rho_{X,Y}). $$

If \(\rho_{X,Y}=-1\), this expectation is zero, so \(U=-V\) almost surely. Therefore \(Y-E[Y]=-(\sigma_Y/\sigma_X)(X-E[X])\), whose slope is negative. Conversely, that negative centered relationship makes \(U=-V\) almost surely and yields correlation −1. These arguments give both directions of the equality condition.

1
Check the variances.
Confirm that both variables have finite, strictly positive variances. Otherwise their correlation is not defined by the formula.
2
Center the variables.
Write the proposed relationship in terms of \(X-E[X]\) and \(Y-E[Y]\), or identify constants \(a\) and \(b\) in \(Y=a+bX\).
3
Check the slope and probability statement.
The relationship must hold almost surely. A positive slope gives correlation 1; a negative slope gives correlation −1.

Worked Examples

Worked Example: A Discrete Relationship With Negative Slope

A hypothetical payment model has \(X\) taking values 1, 3, and 5 with probabilities 0.2, 0.5, and 0.3, respectively. Let \(Y=12-2X\). Find the means, variances, covariance, and correlation, and verify the equality condition.

Method. Compute the moments from the distribution of \(X\), use the affine relationship to obtain the moments involving \(Y\), and check the slope. This avoids treating the negative sign in the slope as a negative variance.

First, the probabilities sum to \(0.2+0.5+0.3=1\). The mean of \(X\) is \(E[X]=1(0.2)+3(0.5)+5(0.3)=0.2+1.5+1.5=3.2\). Also, \(E[X^2]=1^2(0.2)+3^2(0.5)+5^2(0.3)=0.2+4.5+7.5=12.2\). Therefore, \(\operatorname{Var}(X)=12.2-(3.2)^2=12.2-10.24=1.96\), which is positive.

The relationship \(Y=12-2X\) gives \(E[Y]=12-2E[X]=12-6.4=5.6\). For an affine transformation, variance is multiplied by the square of the slope, so \(\operatorname{Var}(Y)=(-2)^2(1.96)=7.84\). The covariance is \(\operatorname{Cov}(X,Y)=\operatorname{Cov}(X,12-2X)=-2\operatorname{Var}(X)=-3.92\).

Both variances are positive, and the correlation is \(\rho_{X,Y}=-3.92/(\sqrt{1.96}\sqrt{7.84})=-3.92/(1.4\cdot2.8)=-3.92/3.92=-1\). The affine slope is \(-2\), so the equality condition predicts negative perfect correlation. The computed value agrees.

Worked Example: A Positive-Slope Relationship and Unequal Values

A hypothetical index \(X\) takes values 0, 2, and 4 with probabilities 0.25, 0.50, and 0.25. A second index is defined by \(Y=5+3X\). Verify that the correlation is 1, and explain why \(X\) and \(Y\) are not equal.

Method. Calculate the mean and variance of \(X\), then use the affine transformation for \(Y\) and the covariance. The direct relationship also supplies an equality-condition check.

The probabilities sum to 1. The moments of \(X\) are \(E[X]=0(0.25)+2(0.50)+4(0.25)=0+1+1=2\) and \(E[X^2]=0^2(0.25)+2^2(0.50)+4^2(0.25)=0+2+4=6\). Thus \(\operatorname{Var}(X)=6-2^2=2>0\).

Next, \(E[Y]=5+3E[X]=5+6=11\), \(\operatorname{Var}(Y)=3^2\operatorname{Var}(X)=9(2)=18>0\), and \(\operatorname{Cov}(X,Y)=\operatorname{Cov}(X,5+3X)=3\operatorname{Var}(X)=6\). Consequently, \(\rho_{X,Y}=6/(\sqrt{2}\sqrt{18})=6/\sqrt{36}=6/6=1\).

The positive slope 3 verifies perfect positive correlation. Yet the possible pairs are \((0,5)\), \((2,11)\), and \((4,17)\), so \(X\ne Y\) at every possible outcome. The affine relationship, not equality of the variables, is what makes the correlation perfect.

Worked Example: A Nonlinear Relationship That Is Not Perfectly Correlated

Let \(Z\) take the values −1, 0, and 1, each with probability \(1/3\). Define \(X=Z\) and \(Y=Z^2\). Calculate the correlation and determine whether an affine equality case holds.

Method. Compute the required moments, then check whether the three possible pairs satisfy a single affine relationship. This avoids assuming that any exact functional relationship must be linear.

Both variables have positive probabilities summing to 1. The mean of \(X\) is \(E[X]=(-1+0+1)/3=0\), and \(E[X^2]=(1+0+1)/3=2/3\). Hence \(\operatorname{Var}(X)=2/3\).

The values of \(Y\) are 1, 0, and 1, so \(E[Y]=2/3\). Since \(Y^2=Y\) for these outcomes, \(E[Y^2]=2/3\), and \(\operatorname{Var}(Y)=2/3-(2/3)^2=2/3-4/9=2/9>0\). Also \(XY=Z^3\), whose values are −1, 0, and 1, so \(E[XY]=0\). Therefore \(\operatorname{Cov}(X,Y)=E[XY]-E[X]E[Y]=0-0(2/3)=0\), and \(\rho_{X,Y}=0/(\sqrt{2/3}\sqrt{2/9})=0\).

There is no affine relationship holding on all three possible outcomes. If \(Y=a+bX\), the pairs \((-1,1)\) and \((1,1)\) force \(1=a-b\) and \(1=a+b\), so \(b=0\) and \(a=1\). But the pair \((0,0)\) would then require \(0=1\), a contradiction. The exact relationship \(Y=X^2\) is nonlinear and does not meet the affine equality condition.

Common Exam Trap: Correlation 1 Does Not Mean Identical Variables

A tempting but incorrect shortcut is: “The correlation is 1, so \(X=Y\).” In the second worked example, that calculation would claim \(X=Y\), even though, when \(X=2\), the defined value is \(Y=5+3(2)=11\). The claim fails because correlation measures a standardized linear relationship, not whether the two variables share the same scale or location.

The correction is to use the full condition. With correlation 1, the variables must satisfy \(Y-E[Y]=c(X-E[X])\) almost surely for some \(c>0\), or equivalently \(Y=a+bX\) almost surely with \(b>0\). For correlation −1, the corresponding slope must be negative. In both cases, check that neither variance is zero and that the relationship holds with probability 1, rather than just at a few selected outcomes.

Key takeaway: With finite, positive variances, correlation reaches an endpoint exactly when the centered variables are proportional almost surely. The proportionality constant is positive for correlation 1 and negative for correlation −1.

Check Your Understanding

For each problem, check the variance conditions before using the equality condition.

  1. A variable \(X\) is equally likely to be −2, 0, or 2, and \(Y=7-4X\). What is \(\rho_{X,Y}\)? (Answer: −1)
  2. A random variable \(X\) has mean 4 and standard deviation 2. If \(Y=9+0.5X\) almost surely, find \(E[Y]\), \(\operatorname{Var}(Y)\), and \(\rho_{X,Y}\). (Answer: \(E[Y]=11\), \(\operatorname{Var}(Y)=1\), \(\rho_{X,Y}=1\))
  3. A variable \(X\) is equally likely to be 1, 2, or 3, and \(Y=2X-1\). State the correlation and the centered relationship. (Answer: \(\rho_{X,Y}=1\); \(Y-E[Y]=2(X-E[X])\))
  4. Let \(Z\) be equally likely to be −1, 0, or 1, with \(X=Z\) and \(Y=Z^2\). Find the correlation and state whether the variables satisfy an affine equality case. (Answer: \(\rho_{X,Y}=0\); no affine relationship holds almost surely)
  5. Suppose \(E[X]=8\), \(E[Y]=-2\), \(\operatorname{sd}(X)=3\), \(\operatorname{sd}(Y)=6\), and \(\rho_{X,Y}=-1\). Give the centered relationship and the equivalent affine relationship. (Answer: \(Y-E[Y]=-2(X-E[X])\); \(Y=14-2X\) almost surely)
Clinical Biostats