week_4_1
week_4_1
Integral
f(x)
a b x
1
Integral
f(x)
a b x
You are not required to calculate it, but just understand the meaning of
the notation. 7
Continuous random variable
One step further: from discrete to continuous
8
Continuous random variable
l
• For any specific value X = x, P(X = x) = 0.
Examples
9
Continuous vs discrete random variable
• Although Poisson R.V. has finite number of possible values, they are
countable.
10
Intuition: probability is the area under the curve
PMF, n = 5
0.30
0.25
0.20
Probability
0.15
0.10
0.05
0 1 2 3 4 5
Possible value
11
Intuition: probability is the area under the curve
PMF, n = 20
0.15
Probability
0.10
0.05
0.00
0 5 10 15 20
Possible value
12
Intuition: probability is the area under the curve
PMF, n = 100
0.08
0.06
Probability
0.04
0.02
0.00
0 20 40 60 80 100
Possible value
P(X < 50) =? 50 bars .. It looks more and more like area under a curve,
from (0, 50), right? Recall how do people approxiate area by rectangulars!
13
Intuition: probability is the area under the curve
PMF, n = 1000
Possible value
14
Probability density function
15
Probability density function
• You are not required to calculate the integral, but keep in mind, the
area under the PDF represents probability.
16
PMF vs. PDF
Loosely speaking, as you have more and more and more and more
potential outcomes, PMF becomes a PDF.
17
Properties of PDF
18
Intuition
• I know a bus is going to arrive some time in the next hour, but I
don’t know when. If I assume all times within that hour are equally
likely, what will my PDF look like?
• The PDF is
(
1 if 0 x 1
fX (x) =
0 otherwise
20
Example: continuous uniform random variable
(
1 if 0 x 1
fX (x) =
0 otherwise
21
Example: continuous uniform random variable
(
1 if 0 x 1
fX (x) =
0 otherwise
22
Continuous uniform random variable
What is c?
23
Continuous uniform random variable
What is c?
• Remember, the area under the curve should be 1
• Here, the area is (b a) ⇥ c
• So c must be b 1 a
24
Continuous uniform random variable
25
Cumulative distribution function
26
Cumulative distribution function
27
Cumulative distribution function
• For discrete X , X
E [X ] = xpX (x)
x
.
• We can also think of expectation of a continuous random variable.
The number we would expect to get, on average, if we repeated our
experiment infinitely many times.
• What do you think the expectation of a continuous random variable
is?
R1
• E [X ] = 1 xfX (x)dx.
• Similar to the discrete case, we just replace summation by integral.
29
Expectation of functions of a continuous r.v.
Var[X ] = E [X 2 ] (E [X ])2
• Also,
E [aX + b] = aE [X ] + b
Var[aX + b] = a2 Var[X ]
are always true.
30
The standard normal distribution
31
The standard normal distribution
• If Z ⇠ N(0, 1),
P( 1 < Z < 1) = 0.68
P( 1.96 < Z < 1.96) = 0.95
• Remember this!
加
• The standard normal is not that useful by itself. When we say the
normal distribution, we usually refer to a family of distributions.
• We obtain PDFs of this normal family by shifting the normal curve
around and spreading it out (or tightening it up).
34
The normal distribution
35
Linear transformation of normal distribution
• Let X ⇠ N(µ, 2
).
• Let Y = aX + b.
• So E [Y ] = aE [X ] + b = aµ + b.
• Var[Y ] = a2 Var[X ] = a2 2
.
• In fact, if Y = aX + b, Y is also a normal random variable.
Y ⇠ N(aµ + b, a2 2
)
36
The normal distribution
37
The normal distribution
38
Example: normal distribution
P(SP500 < 0) =?
39
Example: normal distribution
42
Standardization
• Let X ⇠ N(µ, 2
).
• We know
X µ
Z= ⇠ N(0, 1)
X µ E [X ] µ µ µ
E [Z ] = E = = =0
X µ 1 1 2
Var[Z ] = Var = 2
Var[X ] = 2
=1
43
Another example
Prior the 1987 crash of the stock market, monthly S&P500 returns r
followed approximately a normal with mean 0.012 and standard deviation
0.043.
The S&P500 dropped -0.2176 in a month during the crash, how
extreme is it?
• r ⇠ N(0.012, 0.0432 )
• Hard to tell how extreme is it just from those numbers, let’s
standardize the normal.
• We know Z = r 0.043
0.012
⇠ N(0, 1).
• Where is the crash? Calculate corresponding z-score
0.2176 0.012
z= = 5.27
0.043
• It is 5 standard derivation away from the mean!
• Recall that 95% are within 2 standard derivation, this event is very
extreme.
45
More about standardization
46
The standard normal
47
Galton board and normal distribution
48
Galton board and normal distribution
49
Normal approximates binomial when p = 0.5
• Revisit tossing fair coins, X is number of heads you get out of 100
tosses. X ⇠ Bin(100, 0.5).
• Too tedious to compute P(X 25), you need to calculate
probability for X = 0, 1, · · · , 25.
• But we know E [X ] = np = 50, Var[X ] = np(1 p) = 25.
• Approximate it by normal with the same mean and variance
Y ⇠ N(50, 252 )
• P(X = 25) ⇡ P(Y 2 [24.9, 25.1])
> pnorm(25, mean = 50, sd = 5)
[1] 2.866516e-07
> pbinom(25, 100, 0.5)
[1] 2.818141e-07
You can calculate those numbers in Excel! Have a try!
50