Random Variables - Arizona State University

Download Report

Transcript Random Variables - Arizona State University

Probability Distributions
Random Variables: Finite and Continuous
Distribution Functions
Expected value
April 3 – 10, 2003
Random Variables


A random variable is a rule that assigns a numerical
value to each outcome of an experiment
Two types:
–
Discrete:


–
Finite: It can take on only finitely many possible values (ex:
X=0,1,2, or 3). In this case you can list all possible values.
Infinite: It can take on infinitely many values that can be arranged
in a sequence (ex: X=1,2,3,4,…)
Continuous: If the possible values form an entire interval of
numbers (ex: any positive number)
Discrete Random Variables
We want to associate probabilities with the
values that the random variable takes on.
There are two types of functions that allow us to
do this:
 Probability Mass Functions (p.m.f)
 Cumulative Distribution Functions (c.d.f)
Probability Distributions


The pattern of probabilities for a random
variable is called its probability distribution.
In the case of a finite random variable we call
this the probability mass function (p.m.f.),
fx(x) where fx(x) = P( X = x )
n
 P( X  x )  1.
i
i 1
f
all x
X
( x)  1
Thus, 0  f X ( x)  1 for any value of x and
Probability Mass Function (p.m.f)


Using the p.m.f. we can describe various
probabilities of X geometrically
EX: Let X describe the number of heads
obtained when you toss a fair coin twice.
x
P(X=x) or fX
0
.25
1
.50
2
.25
From this table, we have the ordered pairs
(0,.25),(1,.5),(2,.25)
Probability Mass Function




This is a p.m.f which is a
histogram representing the
probabilities
When a histogram is used,
the r.v. X takes on integer
values
In this case P(X=x) equals the
area of the rectangle
Note: For a histogram to
represent a p.m.f, the heights
of the rectangles should sum
to 1
–
This is because the values
along the y-axis represent
probabilities
0.5
0.4
0.3
P(X=x)
0.2
0.1
0
0
1
2
Cumulative Distribution Function




The same probability information is often given
in a different form, called the cumulative
distribution function (c.d.f) or FX
FX(x) = P(Xx)
0  FX(x)  1, for all x
In the finite case, the graph of a c.d.f. should
look like a step function, where the maximum is
1 and the minimum is 0.
Cumulative Distribution Function
Cumulative Distrib ution Function
1.0
0.8
0.6
F X (x )
0.4
0.2
0.0
0
1
2
3
4
5
6
7
x
8
9 10 11 12 13 14
Graphing a CDF (Finite case)




Need to look at every possible x along the x-axis and
see what value of the cdf corresponds to it
Look at intervals – i.e, less than 0, between 0 and 1,
between 1 and 2, etc.
When looking at intervals, include the left most number
but not the right most number – i.e, between 0 and 1,
include 0 but not 1
Find the value of FX(x) = P(X  x) that corresponds
–
For each interval you are looking at, FX(x) should be the same
number
Bernoulli Trials



In a Bernoulli Trial there are only two
outcomes: success or failure
Let p = P(S)
Bernoulli Random Variables were named after
Jacob Bernoulli (1654 – 1705) who was a
famous Swiss mathematician
Binomial Random Variable

Let X stand for the number of successes in n Bernoulli Trials
where X is called a Binomial Random Variable

Binomial Setting:
1. You have n repeated trials of an experiment
2. On a single trial, there are only two possible outcomes
3. The probability of success is the same from trial to trial
4. The outcome of each trial is independent



Expected Value of a Binomial R.V is represented by
E(X)=n*p
BINOMDIST



BINOMDIST is a built-in Excel function that gives
values for the p.m.f and c.d.f of any binomial random
variable
It is located under Statistical in the Function menu
Syntax:
–
BINOMDIST(number_s, trials, probability_s, cumulative)




number_s = cell location of x
trials = how many times you are performing experiment
probability_s = probability of success
cumulative = “false” for pmf; “true” for cdf
Review of Finite Random Variables


Finite R.V takes on a set of discrete values (you can
list all of the numerical values)
Probability Mass Function (p.m.f) describes the
probability distribution
–
–
fx(x) where fx(x) = P( X = x )
graph is a histogram


sum of the heights of the rectangles must equal one
Cumulative Distribution Function (c.d.f)
–
–
FX(x) = P(X  x)
graph is a step function

minimum is 0 and the maximum is 1
Review of Finite Random Variables

Binomial Random Variable is a random variable that
stands for the number of successes in n Bernoulli
Trials
–

Binomial Setting:
–
–
–
–

A Bernoulli Trial has only 2 possible outcomes: success and
failure
You have n repeated trials of an experiment
On a single trial, only two possible outcomes
The probability of success is the same from trial to trial
The outcome of each trial is independent
Expected Value is n(p), where p is the probability of
success and n is the number of trials of the experiment
Continuous Random Variable



Continuous random variables take on values in an
interval; you cannot list all the possible values
Examples:
1. Let X be a randomly selected number between 0
and 1
2. Let R be a future value of a weekly ratio of closing
prices for IBM stock
3. Let W be the exact weight of a randomly selected
student
You can only calculate probabilities associated with
interval values of X. You cannot calculate P(X=x);
however we can still look at its c.d.f, FX(x).
Probability Density Function (p.d.f)




When we looked at finite random variables, we
created a p.m.f graph (histogram)
Our graph had rectangles with a certain width
This width was the distance between two
values of the random variable
When we start to make our width smaller and
smaller, we begin to see a curve
Probability Density Function (p.d.f)






When we look at continuous random variables, we are
looking at random variables that take on every value in
a given interval
The width of our rectangles are now infinitesimally
small
When we look at this histogram, we are approximating
our p.d.f
When we graph all of the values of the continuous r.v,
our p.d.f graph looks like a curver
This graph is called the graph of the Probability Density
Function (p.d.f)
Probability Density Function is represented by fX(x)
Probability Density Function

Below is an example of a p.d.f graph
–
Note: The notation for a pmf and a pdf are the same (fX(x)) –
you will need to be careful about the interpretation of the
function
fX
A
a
b
Probability Density Function (p.d.f)




For the graph of the p.m.f, the values along the y-axis
(the probabilities) summed up to 1
The same holds true for the p.d.f graph
The area under the curve adds up to 1 (because the
area under the graph represents the total probability)
Note: There is no one type of curve that you are
looking for – there are different types of continuous
random variables so the graphs of the pdf will look
different
How to tell if the graph is a p.d.f?




We use the word “curve” but the graph could be a
straight line
We could also have a histogram that is approximating
the p.d.f.
If the area under the graph is 1, then the graph
represents a p.d.f.
If the graph is a histogram, how can you tell what
function it represents?
–
–
In the finite case, the sum of the heights of the rectangles add
up to 1
In the continuous case, the sum of the heights of the
rectangles do add to 1 but the areas of the rectangles do sum
up to 1
Probability Density Function (p.d.f)



For any continuous random variable, X,
P(X=a)=0 for every number a.
Instead of considering what the probability of X
is at a single value, we look for the probability
that X assumes a value in an interval
P(a  X  b) is the probability that X assumes a
value in [a,b]
Probability Density Function (p.d.f)

To find P(a  X  b), we need to look at the
portion of the graph that corresponds to this
interval.
fX
A
a
b
Finding Values of the pdf

To find the probabilities associated with the pdf,
you can calculate them in two ways
–
You can look at the area under the curve associated
with the inteval in question


–
Do this when you are given the pdf function
For example, look at #6 on the random variable worksheet
You can use the cdf

Do this when you are given the cdf function
Calculating P(a  X  b) from a p.d.f
P( X  a )  P (a  X  b)  P (b  X )  1 since the
events are mutually exclusive
P(a  X  b)  1  P( X  a )  P (b  X )
= 1  P ( X  a )  (1  P ( X  b)
= 1  P ( X  a )  1  P ( X  b)
= P ( X  b)  P ( X  a )
= FX (b)  FX (a )
Probability Density Function
A  FX (b)  FX (a)  P(a  X  b)
 P ( a  X  b)
 P ( a  X  b)
 P(a  X  b).
Cumulative Distribution Function




The same probability information is often given in a
different form, called the cumulative distribution
function, (c.d.f), FX
FX(x)=P(Xx)
0  FX(x)  1, for all x
NOTE: Regardless of whether the random variable is
finite or continuous, the cdf, FX, has the same
interpretation
–
I.e., FX(x)=P(Xx)
Cumulative Distribution Function



For the finite case, our c.d.f graph was a step
function
For the continuous case, our c.d.f. graph will
be a continuous graph
Note: The minimum is still 0 and the maximum
is still 1
Cumulative Distribution Function
1.2
1.0
0.8
0.6
0.4
0.2
0.0
F T (t )
-1
0
1
t
2
3
Cumulative Distribution Function
• Now, depending on the type of continuous
random variable, the graph of the cdf will look
different
• Below is an example of a graph of a cdf for a
continuous random variable
Cumulative Distribution Function
1.20
1.00
0.80
0.60
0.40
0.20
0.00
F T (t )
-20
0
20
40
t
60
80
100
Review of Continuous Random
Variables


Continuous R.V. takes on any value in a given interval;
you cannot list all of the values
Probability Density Function (p.d.f.) describes the
distribution of the probabilities
–
–
–
fX(x) where fX(x) does not equal P( X = x )
fX(x) simply represents the height of the curve at a given value
of the random variable
We can only calculate the probabilities of intervals

–
to calcuate P(a  X  b) -- use the graph of the p.d.f and find the
corresponding area under the curve OR calculate FX(b) - FX(a) if
given the c.d.f
P(X=a)=0 for every number a
Review of Continuous Random
Variables

Cumulative Distribution Function (c.d.f)
–
–

FX(x) = P(X  x)
graph is an increasing function with minimum at 0 and
maximum at 1
Note! At every new value of a R.V. (finite or
continuous), a c.d.f adds on the associated probability
of the new value of the R.V
–
–
for finite R.V., it looks like a step funciton since there are only a
finite amount of number
for continuous R.V., it a continuous increasing function

both graphs have minimum at 0 and maximum at 1
Special Types of Continuous R.V.


Exponential random variables usually describe the waiting time
between consecutive events.
In general, the p.d.f and c.d.f for an exponential random variable
X is given as follows:
0 if x  0
f X ( x)   1  x / 
if 0  x
 e



0 if x  0
FX ( x)    x /
1  e if 0  x
 (pronounced alpha) is a Greek letter – it represents a number
in the formula
Remember! P(a<X<b) = FX(b) - FX(a) AND P(X=a)=0 because
an exponential random variable is a continuous random variable
Continuous R.V. with exponential
distribution
Probability Density Function
Cumulative Distribution Function
0.6
0.5
0.4
0.3
0.2
0.1
0.0
f X (x )
-3
1.2
1.0
0.8
0.6
0.4
0.2
0.0
F X (x )
0
3
6
x
9
12
15
-3
0
3
6
x
9
12
15
Special Types of Continuous R.V.



If the probability that X assumes a value is the same for all equal
subintervals of an interval [0,u], then we have a uniform random
variable, where u is the interval length
X is equally likely (probabilities are equal) to assume any value in
[0,u]
If X is uniform on the interval [0,u], then we have the following
formulas:
0 if x  0
1
f X ( x)   if 0  x  u
u
0 if u  x

0 if x  0
x
FX ( x)   if 0  x  u
u
1 if u  x

Continuous R.V. with uniform
distribution
Probbility Density Function
0.0016
0.0012
f X (x ) 0.0008
F X (x )
0.0004
0.0000
-100 0
100 200 300 400 500 600 700 800
x
Cumulative Distribution Function
1.0
0.8
0.6
0.4
0.2
0.0
-100 0 100 200 300 400 500 600 700 800
x
Expected Value





From Project 1, Expected Value of a Finite
Random Variable is
x  P( X  x )

all x

This can now be written as E ( X ) 
x  fX ( x)
This is called the mean of X
all x
It is denoted by X
For a Binomial Random Variable, E(X)=n*p,
where n is the the number of independent trials
and p is the probability of success
Expected Value


If X is continuous, you cannot sum over all the values
of X, since P(X=x)=0 for all x
In general, if X is a continuous random variable with a
UNIFORM distribution on [0,u], then
u
E( X ) 
2

Any EXPONENTIAL random variable X, with
parameter , has
E( X )  
FOCUS ON THE PROJECT

GOAL: To price a European call option on the option’s
starting date

For our project, we are using several Random
Variables
–
–
–
–
–
C, the closing price per share
R, the ratio of closing prices
Rm is the mean of the ratios of closing prices
Rnorm is the continuous r.v. of normalized ratios
Rnorm = R – (Rm-Rrf)
Focus on the project


Use ratios to estimate the basic volatility of stock
Normalize ratios first (IMPORTANT!)
–
–
–
Why? Want to compare how the stock is doing to what the
money is doing in bank (at risk-free rate)
From each ratio, you are going to subtract out the growth rate
of the stock but leave the trend (thus making the growth rate 0)
To each ratio, you are going to add in the carrying cost – the
growth at the risk-free rate (this is from assumption number 4)
Focus on the project




How to normalize? Adjust observed ratios so
average is same as risk-free weekly ratio
I.e., reduce observed ratios by the difference
Rm-Rrf
Now, recall that Rnorm = R – (Rm-Rrf)
Note, the average value of normalized ratios is
Rrf= Rm-(Rm-Rrf)
What should you do?

Since you have all of your ratios (found for
homework #6), you should normalize each of
them.
–
–

I.e, For each ratio that you have, you will need to
subtract Rm-Rrf from each ratio R.
This gives you a Rnorm for each ratio
To do this:
–
–
You will need to find the mean of the ratios
Use the weekly ratio at the risk-free rate