Covariance and Correlation The probability distribution of a random - - PowerPoint PPT Presentation

covariance and correlation
SMART_READER_LITE
LIVE PREVIEW

Covariance and Correlation The probability distribution of a random - - PowerPoint PPT Presentation

ST 370 Probability and Statistics for Engineers Covariance and Correlation The probability distribution of a random variable gives complete information about its behavior, but its mean and variance are useful summaries. Similarly, the joint


slide-1
SLIDE 1

ST 370 Probability and Statistics for Engineers

Covariance and Correlation

The probability distribution of a random variable gives complete information about its behavior, but its mean and variance are useful summaries. Similarly, the joint probability distribution of two random variables gives complete information about their joint behavior, but their means and variances do not summarize how they behave together. We also need to know their covariance: cov(X, Y ) = σXY = E [(X − µX) (Y − µY )] .

1 / 15 Joint Probability Distributions Covariance and Correlation

slide-2
SLIDE 2

ST 370 Probability and Statistics for Engineers

Example: Mobile response time x = Number of bars 1 2 3 Marginal y = Response time 4+ 0.15 0.10 0.05 0.30 3 0.02 0.10 0.05 0.17 2 0.02 0.03 0.20 0.25 1 0.01 0.02 0.25 0.28 Marginal 0.20 0.25 0.55 From the marginal distributions: µX = 1 × 0.20 + 2 × 0.25 + 3 × 0.55 = 2.35, µY = 1 × 0.28 + 2 × 0.25 + 3 × 0.17 + 4 × 0.30 = 2.49.

2 / 15 Joint Probability Distributions Covariance and Correlation

slide-3
SLIDE 3

ST 370 Probability and Statistics for Engineers

Also from the marginal distributions, σ2

X = 0.6275,

σ2

Y = 1.4099.

For the covariance, we need the joint distribution: σXY =

3

  • x=1

4

  • y=1

[(x − µX) (y − µY )] fXY (x, y) = −0.5815.

3 / 15 Joint Probability Distributions Covariance and Correlation

slide-4
SLIDE 4

ST 370 Probability and Statistics for Engineers

Sign of covariance Negative covariance, as here, means that X and Y tend to move in

  • pposite directions: a stronger signal leads to shorter response times,

and conversely. Positive covariance would mean that they tend to move in the same direction; zero covariance would mean that X and Y are not linearly related.

4 / 15 Joint Probability Distributions Covariance and Correlation

slide-5
SLIDE 5

ST 370 Probability and Statistics for Engineers

Magnitude of covariance The magnitude of the covariance is harder to interpret; in particular, it has the units of X multiplied by the units of Y , here seconds2. It is easier to interpret a dimensionless quantity, the correlation coefficient ρXY = cov(X, Y )

  • V (X)V (Y )

= σXY σXσY . The correlation coefficient has the same sign as the covariance, and always lies between −1 and +1; in the example, ρXY = −0.618228.

5 / 15 Joint Probability Distributions Covariance and Correlation

slide-6
SLIDE 6

ST 370 Probability and Statistics for Engineers

Independence If X and Y are independent, then fXY (x, y) = fX(x) × fY (y), and E(XY ) =

  • x
  • y

xyfXY (x, y) =

  • x
  • y

xyfX(x)fY (y) =

  • x

xfX(x)

  • y

yfY (y) = E(X)E(Y ).

6 / 15 Joint Probability Distributions Covariance and Correlation

slide-7
SLIDE 7

ST 370 Probability and Statistics for Engineers

More generally, E[(X − a)(Y − b)] = E(X − a)E(Y − b) and with a = µX and b = µY , cov(X, Y ) = E(X − µX)E(Y − µY ) = 0, and consequently also ρXY = 0. That is, if X and Y are independent, they are also uncorrelated. The opposite is not generally true: if X and Y are uncorrelated, they might or might not be independent.

7 / 15 Joint Probability Distributions Covariance and Correlation

slide-8
SLIDE 8

ST 370 Probability and Statistics for Engineers

Estimating covariance and correlation The covariance σXY and correlation ρXY are characteristics of the joint probability distribution of X and Y , like µX, σX, and so on. That is, they characterize the population of values of X and Y .

8 / 15 Joint Probability Distributions Covariance and Correlation

slide-9
SLIDE 9

ST 370 Probability and Statistics for Engineers

From a sample of values, we estimate µX and σX by ¯ x and sx, the sample mean and standard deviation. By analogy with the sample variance s2

x =

1 n − 1

n

  • i=1

(xi − ¯ x)2, the sample covariance is given by sxy = 1 n − 1

n

  • i=1

(xi − ¯ x)(yi − ¯ y).

9 / 15 Joint Probability Distributions Covariance and Correlation

slide-10
SLIDE 10

ST 370 Probability and Statistics for Engineers

The sample correlation coefficient is rxy = sxy sxsy = n

i=1(xi − ¯

x)(yi − ¯ y) n

i=1(xi − ¯

x)2n

i=1(yi − ¯

y)2. Notice the similarity to the calculation of the regression coefficient ˆ β1 = n

i=1(xi − ¯

x)(yi − ¯ y) n

i=1(xi − ¯

x)2 = sxy s2

x

= rxy × sy sx .

10 / 15 Joint Probability Distributions Covariance and Correlation

slide-11
SLIDE 11

ST 370 Probability and Statistics for Engineers

But note the difference in context: In the regression context, we have a model Y = β0 + β1x + ǫ, in which x is a fixed quantity, and Y is a random variable; In the correlation context, both X and Y are random variables. The connection between correlation and regression is deeper than just the computational similarity, but they are not the same thing.

11 / 15 Joint Probability Distributions Covariance and Correlation

slide-12
SLIDE 12

ST 370 Probability and Statistics for Engineers

Linear Functions of Random Variables

Given random variables X1, X2, . . . , Xp and constants c1, c2, . . . , cp the random variable Y given by Y = c1X1 + c2X2 + · · · + cpXp is a linear combination of X1, X2, . . . , Xp. The expected value of Y is E(Y ) = c1E(X1) + c2E(X2) + · · · + cpE(Xp)

12 / 15 Joint Probability Distributions Linear Functions of Random Variables

slide-13
SLIDE 13

ST 370 Probability and Statistics for Engineers

The variance of Y involves both the variances and covariances of the Xs. If the Xs are uncorrelated, and in particular if they are independent, then V (Y ) = c2

1V (X1) + c2 2V (X2) + · · · + c2 pV (Xp).

13 / 15 Joint Probability Distributions Linear Functions of Random Variables

slide-14
SLIDE 14

ST 370 Probability and Statistics for Engineers

Special case: the average If c1 = c2 = · · · = cp = 1

p, then Y is just ¯

X, the average of X1, X2, . . . , Xp If the Xs all have the same expected value µ, then E ¯ X

  • = µ

and if they are uncorrelated and all have the same variance σ2, then V ¯ X

  • = σ2

p .

14 / 15 Joint Probability Distributions Linear Functions of Random Variables

slide-15
SLIDE 15

ST 370 Probability and Statistics for Engineers

Note that σ ¯

X = σ

√p, which becomes small when p is large. That means that when p is large, ¯ X is likely to be close to µ, a result known as the weak law of large numbers.

15 / 15 Joint Probability Distributions Linear Functions of Random Variables