0% found this document useful (0 votes)
10 views4 pages

MRV2

The document is a class material for a statistics course focused on multiple random variables, covering topics such as covariance, correlation coefficients, and joint probability distributions. It includes definitions, formulas, and examples for both discrete and continuous random variables, along with practical exercises using R programming. Key concepts emphasized are the distinction between correlation and causality, as well as methods for calculating marginal PMFs and joint PDFs.

Uploaded by

hanyeelovesgod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views4 pages

MRV2

The document is a class material for a statistics course focused on multiple random variables, covering topics such as covariance, correlation coefficients, and joint probability distributions. It includes definitions, formulas, and examples for both discrete and continuous random variables, along with practical exercises using R programming. Key concepts emphasized are the distinction between correlation and causality, as well as methods for calculating marginal PMFs and joint PDFs.

Uploaded by

hanyeelovesgod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Seoul National University Instructor: Junho Song

Dept. of Civil and Environmental Engineering [email protected]

457.212 Statistics for Civil & Environmental Engineers


In-Class Material: Class 14
Multiple Random Variables – Part II (A&T: 3.3, Supp #2)

1. Covariance1 and Correlation Coefficient (Recall sample COV and sample corr. coeff.)

(a) Covariance: “mean of product minus product of means”

Cov[𝑋, 𝑌] = 𝐸[(𝑋 − 𝜇𝑋 )(𝑌 − 𝜇𝑌 )] = 𝐸[XY] − 𝜇𝑋 𝜇𝑌

(b) Covariance of discrete r.v.’s: Cov[ X , Y ] =

(c) Covariance of continuous r.v.’s: Cov[ X , Y ] =

(d) Sign of covariance:

y y y

x x x

[ ] [ ] [ ]

(e) Correlation coefficient:


 XY =

(f) Unlike covariance, correlation coefficient is bounded, i.e.   XY 

(g) Correlation coefficient can be used as a relative measure of the strength of statistical
( )

y y y

x x x

[ ] [ ] [ ]

1
The correlation covered in this course is also called ‘linear coefficient of correlation’ or ‘Pearon’s correlation.’
Please note that a rank-based correlation termed ‘Spearman’s rank correlation’ is also often used.

1
Seoul National University Instructor: Junho Song
Dept. of Civil and Environmental Engineering [email protected]

(h) “Correlation is NOT causality”: correlation does not necessarily represent the “cause
and effect” relationship.

or

2. Example of joint PDF ~ two normal random variables (bi-variate joint PDF)

→ See Supplement # 2

Example 1:

Create 1,000 pairs of bivariate standard normal random variables with correlation
coefficient 0 and 0.95 respectively. Compare their scatter plots and sample correlation
coefficients.

install.packages('mvtnorm')
library(mvtnorm)

# Generate 1000 pairs from bi-variate normal distribution (standard


normals with zero correlation)
sample1 = rmvnorm(1000,c(0,0),matrix(c(1,0,0,1),2,2))

plot(sample1,type="p",col="red",asp=1,xlab='Data 1',ylab='Data 2')


cor(sample1) # sample correlation coefficient

# Generate 1000 pairs from binormal distribution (standard normals with


high correlation)
sample2 = rmvnorm(1000,c(0,0),matrix(c(1,0.95,0.95,1),2,2)) # corr coeff =
0.95

lines(sample2,type="p",col="black",pch=3) # 'lines' command overlaps a


given plot
cor(sample2) # sample correlation coefficient

2
Seoul National University Instructor: Junho Song
Dept. of Civil and Environmental Engineering [email protected]

Example 2: Consider two discrete random variables 0.7

X and Y . Their joint PMF is given as 0.6

0.5

(x,y)
x

XY
0.4
1 2

Joint PMF, p
y 0.3

3 0.2 0.1 0.2

0.1

5 0.1 0.6 0

(a) Determine the marginal PMF’s of X and Y , respectively 5 2


y 1

x p X (x) y pY ( y )x

(b) Conditional probability mass function of X given Y = 3 ?

x p X |Y ( x | 3)

(c) Find the means of X and Y , respectively.

(d) Find the standard deviations of X and Y , respectively

(e) Find the covariance between X and Y .

(f) Find the correlation coefficient between X and Y .

3
Seoul National University Instructor: Junho Song
Dept. of Civil and Environmental Engineering [email protected]

Example 3: Consider two random variables X and Y y


within the domain shown in the figure. It is assumed that
the probability of each point in the domain is the same. 2

(a) Determine the joint PDF and plot.

2 x

(b) Determine the marginal PDFs of X and Y ,


respectively.
y

(c) Find the means of X and Y , respectively.

(d) Find the standard deviations of X and Y , respectively.

(e) Find the covariance of X and Y .

(f) Find the correlation coefficient between X and Y . Does the sign make sense to you?
Why (not)?

You might also like