Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 52

ECON10005

Quantitative Methods 1
Continuous Random Variable

Faculty of Business and Economics


Department of Economics
Continuous Random
Variable
• A continuous random variable is one which has a
continuum of outcomes.
• The number of outcomes is uncountably infinite. It is not
possible to list the possible outcomes.
• A continuous random variable is generally defined on
the real numbers, or some interval of the real numbers.

A continuous random variable is often a tractable way to model


situations in which there are many outcomes.

Examples:
• Price
• Income
• Time
• …
2
Probability Density Function (PDF)
Probabilities for continuous random variables are calculated for ranges of outcomes, not individual
outcomes.
 E.g., not , but instead
 This is because the outcome space is too large, any individual point has probability of 0.
(Imagine a point on a line has length of 0)

Definition
A probability density function (pdf) is a function that satisfies
1. for all ,
2. the total area under is equal to 1.

 is NOT a probability. E.g.,

3
From PDF to Probability

𝑃 (𝑥1 < 𝑋 ≤ 𝑥 2 )
ONLY for continuous random variable
𝑓 (𝑥 )

Probabilities are found from areas


under a density function:

𝑥1 𝑥2
4
Uniform Distribution

A uniform distribution is defined on an interval [a, b].


 X can only take values in this interval

The probability density function for a uniform distribution is

• Values taken by X are distributed uniformly across [a, b].

• for x outside [a, b]. Namely, X will NOT show up outside the interval [a,b]

5
Probability in a Uniform Distribution

The probability is the area of blue shaded rectangle 𝑥2 − 𝑥1


𝑃 ( 𝑥 1 < 𝑋 ≤ 𝑥 2 )=
𝑏−𝑎
• The height is the pdf
• The width is

The probability is

This can also be written as

𝑥1 𝑥2

6
Probability in a Uniform Distribution
𝑥2 𝑥2
1 𝑥2− 𝑥1
𝑃 ( 𝑥 1 < 𝑋 ≤ 𝑥 2 )=∫ 𝑓 ( 𝑥 ) 𝑑𝑥=∫ 𝑑𝑥=
𝑥1 𝑥1
𝑏−𝑎 𝑏−𝑎

Example: If , namely, is uniform on [0, 1]. Then

 every interval of equal length has equal probability.

7
Expected Value / Mean
Definition

The expected value (mean) of a continuous random variable with probability density function is

 Heuristically, integration is continuous summation.


 Recall: the expected value of a discrete random variable

The summation is over all possible values of X


 Replace summation by integration and probability by probability density to for the continuous variable’s mean.

Example: if X is uniform on [a, b], then


Think: why a and b instead of and ?

8
Variance
Definition

The variance of a continuous random variable is

 It is the same as a discrete random variable (week 3).


 Recall: for a discrete random variable
 In execution, replace the summation by integration and probability by the PDF

Example: if X is uniform on [0, 1] then . Its PDF is for . Its variance is then

Some algebra in involved. Some help is available.


9
Investment over Multiple Periods

Initial investment of $100. Initial investment of $100.

Last week, Each week, the value might Now, Each week, the value change has a uniform
• Increase by $1 with probability 0.55 distribution, denoted by
• Decrease by $1 with probability 0.45

After 1 year, what is the expected value and standard After 1 year, what is the expected value and standard
deviation of the investment? deviation of the investment?
10
Uniform distribution

Define as the value added to the initial investment in week i.


 Assume each is independent from the others.

For a uniform random variable , its mean (expected value) and variance are

These expressions can be easily found online.

In this example,

11
Why use ?
If ,

A random variable
• Increase by $1 with probability 0.55
• Decrease by $1 with probability 0.45

𝐸 ( 𝑌 𝑖 ) =1 ×0.55 + ( −1 ) ×0.45=0.1
2 2
𝑣𝑎𝑟 ( 𝑌 𝑖 ) =( 1− 0.1 ) ×0.55+ ( −1 −0.1 ) ×0.45=0.99

12
Value after 1 year

[ ] [ ]
52 52

𝐸 (𝑉 )=𝐸 100+∑ 𝑋𝑖 𝑣𝑎𝑟 (𝑉 )=𝑣𝑎𝑟 100+∑ 𝑋𝑖 ONLY because of independence

𝑖=1
𝑖=1
13
Cumulative Distribution Function (CDF)
Definition

If s a continuous random variable with pdf then the cumulative distribution function (cdf) is

measures the area under the pdf up to the point x.

 Green area represents one value.


 Need to collect ALL x and the values of F(x)

x
14
CDF of a Uniform Distribution

means X has a uniform distribution on [a,b]. Its PDF is

for any x outside [a, b].

The uniform cumulative distribution function (CDF) is


for

 F(x)=0 if x < a
 F(x)=1 if x > b

If

15
How to Draw CDF

For each value x, find its corresponding F(x).


 x is on the horizontal axis.
 F(x) is on the vertical axis.

16
How to Draw CDF: Another Example

For each value x, find its corresponding F(x).


 x is on the horizontal axis.
 F(x) is on the vertical axis.

17
A Point in a Continuous Variable
 Recall: Continuous random variables have zero probability outcomes!

For any , consider

As

as for a continuous variable

18
A Point in a Continuous Variable
 Recall: Continuous random variables have zero probability outcomes!

For any , consider

As

as for a continuous variable

19
Discrete Random Variable CDF has Jumps

Example: Binomial with n = 2, p = 0.5. (Discrete)

CDF:

20
ECON10005
Quantitative Methods 1
Normal Distribution

Faculty of Business and Economics


Department of Economics
Normal Distribution
Definition

A random variable is normally distributed with mean


and variance if it has probability density function

where

• X can take any real values on


• “Bell” shaped
• Mean (expected value):
• Symmetric
• Variance:
• Mean=median=
• Notation:

22
Standard Normal Distribution N(0, 1)

• Zero mean

• Unit variance (standard deviation)

23
Change the mean

𝜇=−1
𝜇=2

24
Change the standard deviation

𝜎 =0.5

25
CDF of the Normal Distribution

where ,

 No closed form is available. Numeric methods are used.

Excel: NORM.DIST(TRUE or FALSE)

If , use =NORM.DIST(-1.95, 0, 1, TRUE)=0.02558806

 TRUE: the CDF.


 FALSE: the PDF (not a probability)
 The 3rd input is standard deviation. If , use =NORM.DIST(-1.95, 0, 2, TRUE)
27
Standard Normal CDF

28
Standard Normal CDF

𝑃 ( 𝑍 ≤− 1 )=0.159

29
Standard Normal CDF

𝑃 ( 𝑍 ≤ 0 )=0.5

30
Standard Normal CDF

977

31
Probability in an Interval

, what is the probability ?

𝑃 ( 𝑍 ≤1 ) =NORM .DIST (1,0,1, TRUE )

32
Probability in an Interval

𝑃 (− 0.5<𝑍 ≤ 1)
𝑃 ( − 0.5< 𝑍 ≤1 ) =𝑃 ( 𝑍 ≤1 ) − 𝑃( 𝑍 ≤ −0.5)

= NORM.DIST(1,0,1,TRUE)- NORM.DIST(-0.5,0,1,TRUE)

= 0.8413 - 0.3085 = 0.5328 𝑃 (𝑍 ≤ − 0.5)

33
Finding Normal Distribution Quantiles
(Percentiles)

The “inverse” problem of finding probabilities.


A common problem in statistics :
Given a probability , find such that .

𝑧𝑝
34
Finding Normal Distribution Quantiles
(Percentiles)

If , what is the value such that

Use
=NORM.INV(0.1, 0, 1) = -1.282

𝑝
The 10th percentile of the distribution of Z is

𝑧𝑝
35
Symmetry of the Normal Distribution

If , what is the value such that

This is equivalent to

Use
=NORM.INV(0.9, 0, 1) = 1.282 0.1 0.1

Because normal PDF is symmetric:

-1.282 1.282 36
Example: Height
Suppose height can be considered to be normally distributed across a population. In Sri Lanka,
take the mean height to be 157.5cm with standard deviation of 9.0cm.
How tall does one have to be in order to be in the top 10% of the population?

Define a random variable H for heights in Sri Lanka.

 We need such transformation


We want to find the quantile such that because =NORM.INV() invert the
CDF function, which takes the form
This is because top 10% quantile means . of

Use =NORM.INV(0.9, 157.5, 9) = 169.0cm

37
Example: Height
Suppose height can be considered to be normally distributed across a population. In Australia, take the
mean height to be 168.7cm with standard deviation of 10.1cm.
If an individual is 169cm, where does this place them within this distribution?

Define a random variable H for heights in Australia.

We want to calculate

=NORM.DIST(169, 168.7, 10.1, TRUE) = 0.512.  TRUE means the CDF

This individual is taller than 51.2% of the population.

38
ECON10005
Quantitative Methods 1
Student t Distribution

Faculty of Business and Economics


Department of Economics
t Distribution
Definition

A random variable X is distributed with degrees of freedom equal to if it has probability density function

 is the “Gamma function” (not required in QM1)

Degrees of Freedom (DF)

• If , then
• If , then .
• As

40
t Distribution Varies with DF

41
t Distribution Varies with DF

42
t Distribution Varies with DF

43
t Distribution Varies with DF

44
t Distribution Varies with DF

45
t Distribution Varies with DF

46
T Distribution has Fat Tail

 Fat tail relative to Normal Distribution

 More “outliers”

47
Probability Calculation with t Distribution
Excel: = T.DIST()

Example: Probability of a t distribution with 3 d.f. is less than -1?

=T.DIST(-1, 3, TRUE) = 0.196  True means CDF

-1 48
Probability Calculation with t Distribution
Excel: = T.DIST()

T.DIST(-2, 1, TRUE) = 0.1476 • When DF is small, clear fat tail

T.DIST(-2, 2, TRUE) = 0.0918

T.DIST(-2, 3, TRUE) = 0.0697

T.DIST(-2, 5, TRUE) = 0.0510

T.DIST(-2, 10, TRUE) = 0.0367

T.DIST(-2, 30, TRUE) = 0.0273 • When DF becomes larger, closer to normal

NORM.DIST(-2, 0, 1, TRUE) = 0.0228, where


49
Probability Calculation with t Distribution
Excel: = T.DIST.RT()

 Allows us to calculate the right tail (RT) probability.

Example: Probability of a t distribution


with 3 d.f. being greater than -1

T.DIST.RT(-1, 3) = 0.804

or

1 - T.DIST(-1, 3, TRUE) = 0.804

-1 50
Probability Calculation with t Distribution
Excel: = T.DIST.2T()

 Allows us to calculate two tail (2T) probability.

Example: Probability of a t distribution with 3


d.f. being less than -1 or greater than 1

T.DIST.2T(1, 3) = 0.391

 Can you use T.DIST and/or T.DIST.RT instead?

51
Finding t Distribution Quantiles (Percentiles)
 “Inverse” problem. Find the values for the corresponding probability

Excel: = T.INV(p, df)  It finds the quantile x such that

Example:

=T.INV(0.196, 3) = -0.998 -1

p=0.196

-1 52
Finding t Distribution Quantiles (Percentiles)

Excel: = T.INV.2T(p, df)  It finds the quantile x such that


 It is often used in hypothesis testing

Example:

=T.INV.2T(0.391, 3) = 1

p=0.196 p=0.196

53

You might also like