GPCO 453: Quantitative Methods I Sec 04: Introduction to Probability - - PowerPoint PPT Presentation

gpco 453 quantitative methods i
SMART_READER_LITE
LIVE PREVIEW

GPCO 453: Quantitative Methods I Sec 04: Introduction to Probability - - PowerPoint PPT Presentation

GPCO 453: Quantitative Methods I Sec 04: Introduction to Probability Shane Xinyang Xuan 1 ShaneXuan.com October 18, 2017 1 Department of Political Science, UC San Diego, 9500 Gilman Drive #0521. 1 / 10 ShaneXuan.com Contact Information Shane


slide-1
SLIDE 1

GPCO 453: Quantitative Methods I

Sec 04: Introduction to Probability Shane Xinyang Xuan1 ShaneXuan.com October 18, 2017

1Department of Political Science, UC San Diego, 9500 Gilman Drive #0521. ShaneXuan.com 1 / 10

slide-2
SLIDE 2

Contact Information

Shane Xinyang Xuan xxuan@ucsd.edu The teaching staff is a team! Professor Garg Tu 1300-1500 (RBC 1303) Shane Xuan M 1100-1200 (SSB 332) M 1530-1630 (SSB 332) Joanna Valle-luna Tu 1700-1800 (RBC 3131) Th 1300-1400 (RBC 3131) Daniel Rust F 1100-1230 (RBC 3213)

ShaneXuan.com 2 / 10

slide-3
SLIDE 3

Roadmap

In this section, we cover the basics for probability:

◮ Covariance

ShaneXuan.com 3 / 10

slide-4
SLIDE 4

Roadmap

In this section, we cover the basics for probability:

◮ Covariance ◮ Variance

ShaneXuan.com 3 / 10

slide-5
SLIDE 5

Roadmap

In this section, we cover the basics for probability:

◮ Covariance ◮ Variance ◮ Expectation

ShaneXuan.com 3 / 10

slide-6
SLIDE 6

Central Tendency: Expectation

◮ If the probability distribution of X admits a probability density

function f(x), then the expected value can be computed as E[X] =

  • x∈X xf(x)

if discrete

  • x∈X xf(x)dx

if continuous (1)

ShaneXuan.com 4 / 10

slide-7
SLIDE 7

Central Tendency: Expectation

◮ If the probability distribution of X admits a probability density

function f(x), then the expected value can be computed as E[X] =

  • x∈X xf(x)

if discrete

  • x∈X xf(x)dx

if continuous (1)

◮ Expectation can be viewed as a weighted mean.

ShaneXuan.com 4 / 10

slide-8
SLIDE 8

Expectation: Example

The County of San Diego has conducted a food facility inspection search of 300 restaurants. Each restaurant received a rating on a 3-point scale on typical meal price (in columns) and quality (in rows).

Table: Food Facility Inspection Results

1 2 3 Total 1 42 39 3 84 2 33 63 54 150 3 3 15 48 66 Total 78 117 105 300 a.) Develop a bivariate probability distribution for quality (x) and meal price (y) of a randomly selected restaurant in San Diego. b.) Compute the expected value for quality rating, x.

ShaneXuan.com 5 / 10

slide-9
SLIDE 9

Variability: Variance

◮ We want to measure how far X is from its expected value

µX, and the simplest one to work with algebraically is the squared difference (X − µX)2.

ShaneXuan.com 6 / 10

slide-10
SLIDE 10

Variability: Variance

◮ We want to measure how far X is from its expected value

µX, and the simplest one to work with algebraically is the squared difference (X − µX)2.

◮ We define the variance to be the expected distance from X to

µX: Var(X) ≡ E[(X − µX)2] (2)

ShaneXuan.com 6 / 10

slide-11
SLIDE 11

Variability: Covariance

◮ What does E[(X − µX)(Y − µY )] mean?

ShaneXuan.com 7 / 10

slide-12
SLIDE 12

Variability: Covariance

◮ What does E[(X − µX)(Y − µY )] mean?

E[(X − µX)(Y − µY )] = E[XY − XµY − µXY + µXµY ]

ShaneXuan.com 7 / 10

slide-13
SLIDE 13

Variability: Covariance

◮ What does E[(X − µX)(Y − µY )] mean?

E[(X − µX)(Y − µY )] = E[XY − XµY − µXY + µXµY ] = E[XY ] − E[XµY ] − E[µXY ] + E[µXµY ]

ShaneXuan.com 7 / 10

slide-14
SLIDE 14

Variability: Covariance

◮ What does E[(X − µX)(Y − µY )] mean?

E[(X − µX)(Y − µY )] = E[XY − XµY − µXY + µXµY ] = E[XY ] − E[XµY ] − E[µXY ] + E[µXµY ] = E[XY ] − µY E[X] − µXE[Y ] + µXµY

ShaneXuan.com 7 / 10

slide-15
SLIDE 15

Variability: Covariance

◮ What does E[(X − µX)(Y − µY )] mean?

E[(X − µX)(Y − µY )] = E[XY − XµY − µXY + µXµY ] = E[XY ] − E[XµY ] − E[µXY ] + E[µXµY ] = E[XY ] − µY E[X] − µXE[Y ] + µXµY = E[XY ] − µY µX − µXµY + µXµY

ShaneXuan.com 7 / 10

slide-16
SLIDE 16

Variability: Covariance

◮ What does E[(X − µX)(Y − µY )] mean?

E[(X − µX)(Y − µY )] = E[XY − XµY − µXY + µXµY ] = E[XY ] − E[XµY ] − E[µXY ] + E[µXµY ] = E[XY ] − µY E[X] − µXE[Y ] + µXµY = E[XY ] − µY µX − µXµY + µXµY = E[XY ] − µXµY

ShaneXuan.com 7 / 10

slide-17
SLIDE 17

Variability: Covariance

◮ What does E[(X − µX)(Y − µY )] mean?

E[(X − µX)(Y − µY )] = E[XY − XµY − µXY + µXµY ] = E[XY ] − E[XµY ] − E[µXY ] + E[µXµY ] = E[XY ] − µY E[X] − µXE[Y ] + µXµY = E[XY ] − µY µX − µXµY + µXµY = E[XY ] − µXµY = E[XY ] − E[X]E[Y ]

ShaneXuan.com 7 / 10

slide-18
SLIDE 18

Variability: Covariance

◮ What does E[(X − µX)(Y − µY )] mean?

E[(X − µX)(Y − µY )] = E[XY − XµY − µXY + µXµY ] = E[XY ] − E[XµY ] − E[µXY ] + E[µXµY ] = E[XY ] − µY E[X] − µXE[Y ] + µXµY = E[XY ] − µY µX − µXµY + µXµY = E[XY ] − µXµY = E[XY ] − E[X]E[Y ]

◮ Note that what we just proved is the definition of covariance:

ShaneXuan.com 7 / 10

slide-19
SLIDE 19

Variability: Covariance

◮ What does E[(X − µX)(Y − µY )] mean?

E[(X − µX)(Y − µY )] = E[XY − XµY − µXY + µXµY ] = E[XY ] − E[XµY ] − E[µXY ] + E[µXµY ] = E[XY ] − µY E[X] − µXE[Y ] + µXµY = E[XY ] − µY µX − µXµY + µXµY = E[XY ] − µXµY = E[XY ] − E[X]E[Y ]

◮ Note that what we just proved is the definition of covariance:

Cov(X, Y ) ≡ E[(X − µX)(Y − µY )]

ShaneXuan.com 7 / 10

slide-20
SLIDE 20

Variability: Covariance

◮ What does E[(X − µX)(Y − µY )] mean?

E[(X − µX)(Y − µY )] = E[XY − XµY − µXY + µXµY ] = E[XY ] − E[XµY ] − E[µXY ] + E[µXµY ] = E[XY ] − µY E[X] − µXE[Y ] + µXµY = E[XY ] − µY µX − µXµY + µXµY = E[XY ] − µXµY = E[XY ] − E[X]E[Y ]

◮ Note that what we just proved is the definition of covariance:

Cov(X, Y ) ≡ E[(X − µX)(Y − µY )] = E[XY ] − µXµY

ShaneXuan.com 7 / 10

slide-21
SLIDE 21

Sample Covariance

◮ The sample covariance is calculated as

σxy = (xi − ¯ x)(yi − ¯ y) n − 1 (3)

ShaneXuan.com 8 / 10

slide-22
SLIDE 22

Sample Covariance

◮ The sample covariance is calculated as

σxy = (xi − ¯ x)(yi − ¯ y) n − 1 (3)

◮ If X is above its mean when Y is also above its mean and

vice versa, then the covariance will be positive.

ShaneXuan.com 8 / 10

slide-23
SLIDE 23

Correlation

◮ It is difficult to compare covariances across different sets of

random variables, because a bigger covariance might just be due to a different scale.

ShaneXuan.com 9 / 10

slide-24
SLIDE 24

Correlation

◮ It is difficult to compare covariances across different sets of

random variables, because a bigger covariance might just be due to a different scale.

◮ Correlation is scale free

ρxy = σxy σxσy (4)

ShaneXuan.com 9 / 10

slide-25
SLIDE 25

Correlation

◮ It is difficult to compare covariances across different sets of

random variables, because a bigger covariance might just be due to a different scale.

◮ Correlation is scale free

ρxy = σxy σxσy (4)

◮ Note that ρxy ∈ [−1, 1]

ShaneXuan.com 9 / 10

slide-26
SLIDE 26

Sample Covariance: Example

Consider the table below: xi 6 12 13 15 yi 5 6 8 1 Compute covariance and correlation coefficient. Recall that σxy = (xi − ¯ x)(yi − ¯ y) n − 1 (5) ρxy = σxy σxσy (6)

ShaneXuan.com 10 / 10