random variables

35
statistical processes 1 Random Variables Intro to discrete random variables

Upload: quinta

Post on 13-Jan-2016

25 views

Category:

Documents


0 download

DESCRIPTION

Random Variables. Intro to discrete random variables. Random Variables. “A random variable is a numerical valued function defined over a sample space” What does this mean in English? If Y  rv then Y takes on more than 1 numerical value Sample space is set of possible values of Y - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Random Variables

statistical processes 1

Random Variables

Intro to discrete random variables

Page 2: Random Variables

statistical processes 2

Random Variables

“A random variable is a numerical valued function defined over a sample space”

What does this mean in English?

If Y rv then Y takes on more than 1 numerical value

Sample space is set of possible values of Y

What are examples of random variables?

Let Y face showing on die ={1,2, …, 6}

Page 3: Random Variables

statistical processes 3

VariablesA Simple Taxonomy

Variables

Random Variables Deterministic variables

Discrete random variables

Continuousrandom variables

Variables arebut models

Variables arebut models

Page 4: Random Variables

statistical processes 4

Random VariablesA Simple Example

Variables model physical processes

Let S sales; C costs; P profit

P = S - C

Suppose all variables deterministic S = 25 and C = 15, P = 10

Suppose S is a rv = {25, 30} What is P?

RVs may be used just as deterministic variables

How shall we describe the behavior of a rv?

Page 5: Random Variables

statistical processes 5

Developing RV Standard ModelsDistribution Functions

Distribution functions assign probability to every real numbered value of a rv

Probability Mass Function (PMF) assigns probability to each value of a discrete rv

Probability Density Function (PDF) is a math function that describes distribution for a continuous rv

Standard models convenient for describing physical processes

Example of PMF: Let T project duration (a rv)t1 = 4 weeks; p(T = t1) = p(t1) = 0.2

t2 = 5 weeks; p(T = t2) = p(t2) = 0.3

t3 = 6 weeks; p(T = t3) = p(t3) = 0.5

Note conventions!

Note conventions!

Page 6: Random Variables

statistical processes 6

Characteristic Measures for PMFsCentral Tendency

Central tendency of a pmf

Mean or average

y all

)]([)( ypyyE

What is E(T) for project duration example?

= 4(0.2) + 5 (0.3) + 6(0.5) = 5.3 weeks

What if C = f(T), where C costs

Is C a random variable?

What is E(C)?

Page 7: Random Variables

statistical processes 7

Mean of a Discrete RVInteresting Characteristics

Expected value of a function of y, a discrete rv

Let g(y) be function of y

Suppose C = g(T) = 5T + 3, find E(C)

E(C) = [5(4)+3]0.2 + [5(5)+3]0.3 + [5(6)+3]0.5 = 29.5

Let d = constant

E(d)= constant

E(dy)= dE(y)

E() is a linear operator

E(X + Y) = E(X) + E(Y), where X & Y are rv

y all

)]()([)]([ ypygygE

Page 8: Random Variables

statistical processes 8

Random VariableVariance - A Measure of Dispersion

Variance of a discrete rv

Previously defined variance for population & sample

jy all

2j

22 )()-(y)( jypyE

1

)(

:Variance Sample

)()(

:Variance Population

1

2

2

1

2

1

2

2

n

yys

n

d

n

y

n

i

i

n

i

i

n

i

i

Page 9: Random Variables

statistical processes 9

Mean and VarianceInterpretation

Mean

Expected value of the random variable

Variance

Expected value of distance2 from mean

22 )(

)(

yE

yE

Page 10: Random Variables

statistical processes 10

Discrete Random VariablesUseful Models

Examine frequently encountered models

Be sure to understand

Process being modeled by random variable

Derivation of pmf

Use of Excel Calculating pmf Graphing pmf

Page 11: Random Variables

statistical processes 11

Binomial Distribution FunctionSetting the Stage

Bernoulli rv

Models process in which an outcome either happens or does not

A binary outcome What are examples?

Formal description

Trial results in 1 of 2 mutually exclusive outcomes

Outcomes are exhaustive

P(S) = p ; P(F) = q ; p + q = 1.0

Page 12: Random Variables

statistical processes 12

Probability Mass FunctionBernoulli RV

2)(

)(

1 y for p

0 yfor q)(

occur doesevent if S,or 1

occurnot doesevent if F,or 0

pqyVAR

pyE

yP

y

yHow can we derive these?

Page 13: Random Variables

statistical processes 13

Deriving the mean and variance of a Bernoulli Random Variable

Deriving the mean of a rv:

ppppyypyE

yypyE

qp

ppyp

y

y

)1()0(0)1(1)()(

)()(

)0(

)1()1(

We know that

and

We also know that

So it follows that

Page 14: Random Variables

statistical processes 14

Deriving the variance of a random variable

pqpppp

p

pp

ypyyE

)1(

)1(

)0()0()1()1(

)()(

22

22

2222

22222

Page 15: Random Variables

statistical processes 15

Binomial DistributionProblem Description

Problem:

Given n trials of a Bernoulli rv, what is probability of y successes?

Why is y a discrete rv?

Simple example

Toss coin 3 times, find P(2 heads)

n = 3 ; y = 2

P(H, H, T) = (.5)(.5)(.5) = 0.125

Could also be (H,T,H) or (T, H, H)

P(2 heads) = 0.125 + 0.125 + 0.125 = 0.375

Page 16: Random Variables

statistical processes 16

Binomial Distribution FunctionGeneralizing From Simple Example

Recall 2 heads in three tosses

How many different ways is this possible? Combination of three things taken two

at a time

3!1!2

!3

)!(!

!

2

3

nNn

N

Returning to the P(2 heads)

375.0)5.0()5.0(32

3 heads) P(2 212

qp

Page 17: Random Variables

statistical processes 17

Binomial Distribution FunctionCreating the Model

Key assumption

Each trial an independent, identical Bernoulli variable

E(y) = np

Var(y) = npq

ynyqpy

n

P(y)

trialsBernoullin in successes of # y Let

y n

# of combinationsProbability of y successes

Probability of n - y failures

Page 18: Random Variables

statistical processes 18

Binomial Distribution FunctionSimple Problem

Have 20 coin tosses

Find probability that will have 10 or more heads

Set up the problem and will then solve

Let n = 20 y = # of heads p = q = 0.50 Want p(y 10)

Will solve manually and using Excel

Page 19: Random Variables

statistical processes 19

Binomial Example: Manual solution

But remember! This is just for y = 10. We must do this for y = 11, 12, …, 20 as well and then sum all the values!

176.0)756,184(

756,184!10!10

!20

10

20

P(y)

1010

qp

y

n

qpy

n yny

Page 20: Random Variables

statistical processes 20

Page 21: Random Variables

statistical processes 21

Page 22: Random Variables

statistical processes 22

Page 23: Random Variables

statistical processes 23

Multinomial DistributionGeneralizing the Binomial Distribution

Problem

Events E1, …, Ek occur with probabilities p1,

p2, …, pk . Given n independent trials

probability E1 occurs y1 times, … Ek occurs

yk times.

Why is this a more general case than the Binomial?

Can you describe an example?

Page 24: Random Variables

statistical processes 24

Formula for MultinomialUnderstand Relationship to Binomial

kyk

yy

k

k

k

pppyyy

n

yyyp

yYyYyYp

...!,...,!,!

!

),...,,(

),...,,(

2121

21

21

21

This is calleda joint distribution.

Need to understand conventionNote there are k random variables

j = npj j2 = npjqj = npj(1-pj)

Page 25: Random Variables

statistical processes 25

Extending the BinomialTwo Special Cases

Recall Binomial distribution

What problem does it model?

Given n independent trials, p = p(success)

Geometric distribution Define y as rv representing first

success

Negative Binomial Define y as rv representing rth success

Page 26: Random Variables

statistical processes 26

Geometric Distribution

Recall problem statement for geometric

Suppose p = 0.2, what is p(Y=3)?

Only possible order is FFS

p(Y=3) = (.8)(.8)(.2)

Generalizing simple example

p(y) = pqy-1 ; = 1/p ; 2 = q / (p2)

What is implicit assumption about largest value of y?

Page 27: Random Variables

statistical processes 27

Negative Binomial Distribution

2

1

1)(

p

rq

p

r

qpr

yyp ryr

ProblemHave series of Bernoulli trials, want probability of waiting until yth trial to get rth success

Let p = 0.5 & r = 2, do we getreasonable results?

Page 28: Random Variables

statistical processes 28

HypergeometricAn Extension to the Binomial

Suppose have 10 transformers, know 1 is defective

p(defective) = 0.1

Let y = # of defectives in a sample of n

Suppose pick 3 transformers, find p(y=2)

Can I use the Binomial distribution???

Does the p stay constant through all trials??

Page 29: Random Variables

statistical processes 29

Transformer Example

What do you note about example:

p(defective) changed during sampling process # of trials n large with respect to N What if N >> n ?

Would p(defective) change during

sampling process?

Process called sampling without replacement Binomial assumes infinite population OR

sampling with replacement. Why?

If we cannot use Binomial then what?

Hypergeometric Probability Distribution

Page 30: Random Variables

statistical processes 30

Hypergeometric Distribution

n

N

y

r

ypynrN

)(

N # in populationn # in sampler # of Successes in populationy # of Successes in sample

1) Why is y a rv?2) What do we mean byp(y)?3) What is r/N ?

Page 31: Random Variables

statistical processes 31

Poisson ProcessA Useful Model

In a Poisson process

Events occur purely randomly

Over long term rate is constant

What is implication of the above?

Memoryless process

What are some processes modeled as Poisson processes?

Page 32: Random Variables

statistical processes 32

A Poisson Process is a Rate

# of cars passing a fixed point in one

minute

# of defects in an 8x8 sheet of plywood

Page 33: Random Variables

statistical processes 33

Poisson Probability Distribution

2

!)(

y

eyp

y

Where,y # of occurrences in a given unit mean # of occurrences in a given unite 2.71828…

Note particularlyinteresting relationship

Note must be for the same unit of measure!

Why does thismake sense?

Page 34: Random Variables

statistical processes 34

Discrete Random VariablesExcel Special Functions

SpecialFunctions

SpecialFunctionsExcel

HYPGEOMDISTBINOMDISTNEGBINOMDISTPOISSON

Are there others?

Page 35: Random Variables

statistical processes 35

Class 3 Readings & Problems

Reading assignment

M & S Chapter 4 Sections 4.1 - 4.10

Recommended problems

M & S Chapter 4 59, 69, 84, 87, 88, 90, 96, 98, 100