Docsity

Random Variables - Statistics for Scientists - Handout | STAT 3000, Study notes of Statistics

Toggle sidebar
bg1
Stat 3000 – Statistics for Scientists and Engineers
Dr. Corcoran, Summer 2009
II. Random Variables
Random variables operate in much the same way as the outcomes
or events in some arbitrary sample space – the distinction is that
random variables are simply outcomes that are represented
numerically.
As with events, we denote a random variable as a capital letter,
such as X, Y, or Z. Realizations of a random variable are denoted
using lower case. For instance, xmay be used to represent a
possible value of the variable X.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download Random Variables - Statistics for Scientists - Handout | STAT 3000 and more Study notes Statistics in PDF only on Docsity!

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

II. Random Variables

Random variables operate in much the same way as the outcomesor events in some arbitrary sample space – the distinction is thatrandom variables are simply outcomes that are representednumerically.As with events, we denote a random variable as a capital letter,such as

X
,^
Y

, or

Z

. Realizations of a random variable are denoted

using lower case. For instance,

x

may be used to represent a

possible value of the variable

X

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Variable Types

RandomVariables

Discrete/Categorical (e.g., ethnic group, gender)

Continuous

(e.g., age, height, weight)

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Example II.A

Consider an experiment where we flip a coin: the sample space is S

= {H, T}.

We can define a random variable

X

such that

X

= 1 if the flip turns

up heads and

X

= 0 if the flip is tails.

Example II.B

Consider an experiment where we sample an adult and ask forhis/her age in years: we might view the sample space assomething like

S

Suppose we let

Y

= the person’s age in years. Then in this case the

mapping of outcomes in

S

to numeric values is straightforward.

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Categorical Random Variables

Possible values of a categorical random variable have probabilitiesdetermined by a

probability mass function

, or

pmf

Suppose that

x

x^2

xN

are the

N

possible outcomes of a random

variable

X

. The pmf for

X

, denoted by

f

( x

) or

P
( X

x

), must have

the following properties:

i. ii.

and , , , 1

for, 1 )

(

0

N

i

x

X P

i^

K

≤

=

≤

. 1 )

( 1 ∑=

=

=

N i

xi

X P

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Example II.C (cont’d)

The third column in the previous table contains the

cumulative

distribution function

cdf

), or

P
( X

x^ i

). Note that the pmf

determines the cdf, and vice versa. The pmf and cdf are plottedbelow:

CDF x

P(X <= x)

2

4

6

8

10

12

1.0 0.8 0.6 0.4 0.2 0.

2

3

4

5

6

7

8

9

10

11

12

0.15 0.10 0.05 0.

PDF x

P(X = x)

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Continuous Random Variables

As opposed to a probability mass function, a continuous randomvariable has a

probability density function

, or

pdf

Suppose a continuous random variable

X

can take any value

between

l

and

u

. We denote the pdf of

X

by

f

( x

), for

l

x

u

However, note that

f

( x

)^
P(
X

x

). Why must this be so?

How then do we interpret the pdf for a continuous randomvariable?

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Properties of the Probability Density Function

Given a pdf

f

( x

), we can compute the probability over an interval by

This probability has two interpretations:

It represents the probability that a randomly selectedindividual from the underlying population will have a valueof

X

that falls within the interval (

a

,^

b

It represents the proportion of individuals in the underlyingpopulation who have values for

X

that fall within the interval

( a

,^

b

(^

∫

b a^

dx

x f b X a P

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Properties of the Probability Density Function

Hence, a pdf

f

( x

) must have the following properties:

i.

f (

x )

0, for

l

x

u

ii.

. 1

) (^

=

u ∫ l^

dx x f

In other words, a pdf

f (

x ) must be positive over its domain (

l ,

u

and the area under the curve over that domain must be equal to 1.

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Lifetime of Chip -- x

P.D.F. of Chip Lifetime -- f(x)

0

10

20

30

40

50

0.06 0.05 0.04 0.03 0.02 0.01 0.

Survival Time

X

After Diagnosis (months)

X ) of Survival Time x ( f PDF

Example II.D, cont’d

Probability density function for survival time of cancer patients.

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Example II.D, cont’d

Compute the probabilities that you diagrammed on the plot of thepdf. Find and plot the cumulative distribution function. Use the cdf tocompute the probabilities that you diagrammed on the plot of thepdf. What is the median survival time?What is the 75

th

percentile of survival?

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Definition of Expectation

By definition, the average or

expected value

of a categorical

random variable

X
  • with pmf at a value

x

given by i^

P
( X

x

) for i

i^

N
  • is computed as
(^

1 ∑=

N i

i

i^

x X P x X E

The expected value of a continuous random variable

X

with pdf

given by

f

( x

), for

l

x

u

, is computed as

(^

∫

u l

dx

x

xf

X

E

In either case, we can view the expectation as a “weighted”average.

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Example II.E

The expected value of the distribution in

Example II.C

is given by

Playing the game described on the previous slide probablywouldn’t be your smartest move – that is, what would be youraverage net gain (or loss)?In general, how do we interpret expectation? How would youdescribe expectation to the average person? (Hint: recall ourdiscussion of long-term relative frequency.)

(^
L
X
E

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

The Variance of a Random Variable

The mean is used to describe the center of a distribution. The variance

is used to describe the “spread” of a distribution about its

mean.As shown in the plot below, two distributions with the same meancan have very different degrees of variability about the mean:

Stat 3000 – Statistics for Scientists and EngineersDr. Corcoran, Summer 2009

Interpreting the Variance

The variance is actually the

average squared deviation

of the

possible values of a random variable about its mean.

In some sense, you can think of variance probabilistically:(i)

If you sample one observation at random from a distributionwith high variance, then there is a relatively high probabilitythat the observation will lie far away from the mean.

(ii) If you sample an observation from a distribution with low

variance, then there is a relatively small probability that theobservation will lie far from the mean.