Download Continuous Random Variables

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Continuous Random Variables
Reading: Chapter 3.1 – 3.8
Homework: 3.1.2, 3.2.1, 3.2.4, 3.3.2, 3.3.7,
3.4.4, 3.4.5, 3.4.9, 3.5.3., 3.5.6,
3.6.1, 3.6.6, 3.7.1, 3.7.3, 3.7.11, 3.8.1.
Cumulative Distribution Function
CDF of a random variable X is: FX(x) = P[X≤x]
X is a continuous random variable if FX(x) is
continuous. (the range of X contains a
continuous interval)
Example:
X: a random integer between 0 and 4.
SX={0,1,2,3,4}
PX(x) = 0.2 for x=0,1,2,3,4 and 0 otherwise
FX(x) is an non-decreasing piece-wise constant function that is not
continuous at x=0,1,2,3,4
Y: a random real number between 0 and 4.
SY =[0,4] is a continuous region, not a countable set.  0

FY[y] = P[Y≤y] = ?
FY ( y ) =  y / 4
PY[Y=y] = ?
 1

G. Qu
ENEE 324 Engineering Probability
y<0
0≤ y≤4
y>4
2
1
Properties of CDF
Theorem 3.1: for any random variable X
FX(-∞) = 0, FX(∞) = 1
FX(x) = 0 for x<xmin, FX(x) = 1 for x ≥xmax
FX(x) ≥ FX(x’) if x≥x’
FX(x) – FX(x’) = P[x’< X ≤ x]
Example: Quiz 3.1
P[Y≤-1]
P[Y≤1]
P[2<Y≤3]
P[Y>1.5]
G. Qu
y<0
 0

FY ( y ) =  y / 4 0 ≤ y ≤ 4
 1
y>4

ENEE 324 Engineering Probability
3
Probability Density Function
The PDF of a continuous random variable X is
f X ( x) =
dFX ( x)
F ( x + ∆) − FX ( x)
= lim X
∆
→
0
dx
∆
What does PDF tell directly?
large fX(x) implies that FX(x) increases fast at x.
fX(x) is the slope of CDF at x, it measures how
fast CDF FX(x) increases.
large fX(x) implies that higher probability that X
has value close to x. Similar to PX(x).
f X ( x) ∆ = FX ( x + ∆ ) − FX ( x) = P[ x ≤ X ≤ x + ∆ ]
G. Qu
ENEE 324 Engineering Probability
4
2
Properties of PDF
Theorem 3.2: for any random variable X
fX(x) ≥ 0
FX (x) =
∫
∞
−∞
∫
x
−∞
f X ( t ) dt
f X ( t ) dt = F X ( ∞ ) = 1
Theorem 3.3:
∫
x2
x1
f X ( t ) dt = P [ x1 ≤ X ≤ x 2 ]
Example: Problem 3.2.5
Find the conditions for a and b to make fX(x) a
valid PDF.
ax 2 + bx 0 ≤ x ≤ 1
f X ( x) = 
otherwise
 0
G. Qu
ENEE 324 Engineering Probability
5
Expected Values
For discrete r.v. X, E[X] = ∑ xPX(x)
∞
For continuous r.v X, E[ X ] = ∫ xf X ( x)dx
∞
−∞
Theorem 3.4: E[ g ( X )] = ∫−∞ g ( x) f X ( x)dx
Theorem 3.5:
E[X-µX] = 0
E[aX+b] = aE[X]+b
Var[X] = E[X2] – E[X]2
Var[aX+b] = a2Var[X]
G. Qu
ENEE 324 Engineering Probability
6
3
In-class Quiz
Quiz 3.3: Given the PDF of r.v. Y below, find
Expected value: E[Y]=?
Second moment: E[Y2]=?
Variance: Var[Y]=?
Standard deviation: σY=?
3 y 2 / 2 − 1 ≤ x ≤ 1
fY ( y ) = 
otherwise
 0
G. Qu
ENEE 324 Engineering Probability
7
Uniform Random Variable
Discrete
Continuous
 1

x = a, a + 1,..., b
PX ( x) =  b − a + 1
 0
otherwise

0
 x  − a + 1
FX ( x) = 
 b − a +1
1

x<a
a≤ x≤b
x>b
 1

f X ( x) =  b − a
 0
 0
x−a
FX ( x) = 
b − a
 1
a≤ x≤b
otherwise
x<a
a≤ x≤b
x>b
E[X] = (a+b)/2
E[X] = (a+b)/2
Var[X] = (b-a)(b-a+2)/12
Var[X] = (b-a)2/12
G. Qu
ENEE 324 Engineering Probability
8
4
Example: Quiz 3.4*
X: uniform continuous r.v.
E[X] = 3
Var[X] = 3
Find PDF.
Solve for a and b with a<b
E[X]=(a+b)/2 = 3
Var[X] = (a-b)2/12 = 3
⇒ a=0, b=6
G. Qu
1

f X ( x) =  6
 0
0≤ x≤6
otherwise
ENEE 324 Engineering Probability
9
Exponential Random Variable
Continuous (λ >0)
λ e − λx
f X ( x) = 
 0
E[X] = 1/ λ
Var[X] = 1/λ2
G. Qu
K = X: discrete r.v.
x≥0
x<0
1 − e − λ x
FX ( x ) = 
 0
discretization (λ >0)
x≥0
otherwise
PK(k) = P[K=k] = fX(k1<X≤k] = FX(k)-FX(k-1)
= e-λ(k-1)(1-e-λ)
PK(k) = p(1-p)k-1
Geometric r.v.
E[K] = 1/ p
Var[K] = (1-p)/p2
ENEE 324 Engineering Probability
10
5
Example: Quiz 3.4
X: exponential continuous r.v.
E[X] = 3
Var[X] = 9
Find PDF.
Solve for λ
E[X] = 1/ λ = 3
Var[X] = 1/λ = 9
2
⇒λ = 1/3
G. Qu
1 − x / 3
 e
f X ( x) =  3
 0
x≥0
otherwise
ENEE 324 Engineering Probability
11
Example 3.14
T: length of a phone call, exponential (λ=1/3)
RA: charge by A, $.15/min for T
RB: charge by B, $.15/min for T
E[RB]=?
0.15*E[T] = 0.15/λ = $0.45
What random variable is T?
E[RA]=?
G. Qu
0.15*E[T] = 0.15/(1-e-1/3)
≈ $0.53
ENEE 324 Engineering Probability
12
6
Erlang Random Variable
Erlang (n, λ >0)
 λ n x n −1 e − λ x

f X ( x ) =  ( n − 1)!

0
Erlang (1, λ):
exponential
x≥0
λe − λx
f X ( x) = 
 0
x<0
k −λx

n−1 (λx) e
1− ∑
k =0
FX ( x) = 
k!

0
E[X] = n/ λ
Var[X] = n/λ2
G. Qu
x≥0
x<0
x≥0
Poisson (α)
o.w.
α k e −α / k! k ≥ 0
PK (k ) = 
0
k <0

FK (n − 1) = ∑k =0
n −1
ENEE 324 Engineering Probability
( λx ) k e − λx
k!
13
Erlang: PDF ⇔ CDF
See handout.
G. Qu
ENEE 324 Engineering Probability
14
7
Gaussian Random Variables
Gaussian (µ,σ),
normal N[µ,σ2]:
f X ( x) =
−
1
2πσ
2
e
( x− µ )2
2σ 2
Theorem 3.12: For Gaussian (µ,σ) random
variable X,
E[X] = µ, Var[X] = σ2
G. Qu
ENEE 324 Engineering Probability
15
Proof of Theorem 3.12
See handout.
G. Qu
ENEE 324 Engineering Probability
16
8
Standard Normal Random Variable
Standard normal r.v.: Gaussian (0,1), N[0,1].
CDF of N[0,1]:
Φ(z) =
Theorem 3.15: Φ(-z) = 1 – Φ(z)
1
2π
∫
z
e −u
−∞
2
/2
du
Complementary CDF: Q(z) = P[Z>z] = 1 – Φ(z)
G. Qu
ENEE 324 Engineering Probability
17
Proof of Theorem 3.15
See handout.
G. Qu
ENEE 324 Engineering Probability
18
9
Linear Transform of a Gaussian
Random Variable
X: Gaussian (µ,σ) random variable
Define Y=aX+b
FY(y) = P[Y ≤y] = P[aX+b ≤y] = P[X≤ (y-b)/a] = FX((y-b)/a)
fY(y) = (d/dy)(FX((y-b)/a)) = fX((y-b)/a)) (1/a)
Plug in the definition of fX(x), we can see that Y is Gaussian.
This is for a>0. Similarly we can show this is true for a<0
and a=0.
Theorem 3.13: For any Gaussian (µ,σ) random
variable X, Y=aX+b is Gaussian (µ’,σ’), where
µ’ = aµ+b and σ’=aσ.
G. Qu
ENEE 324 Engineering Probability
19
More on Gaussian Random Variables
From Theorem 3.13, we can find a linear
transformation between two Gaussian
random variables.
So any Gaussian (µ,σ) random variable X can be
expressed as σY + µ where Y is N[0,1] , and
Theorem 3.14: The CDF of Gaussian (µ,σ)
x−µ
random variable X is
FX ( x) = Φ (
)
σ
We can get the CDF of all Gaussian r.v. for the
values of Φ(z) (z≥0, see table 3.1).
G. Qu
ENEE 324 Engineering Probability
20
10
Examples
Example 3.16, 3.17:
X is a Gaussian (61,10) random variable
P[X≤46]=?
P[51<X≤71]=?
Quiz 3.5
X is N[0,1], Y is N[0,2]
P[-1<X≤1], P [-1<Y≤1], P[X>3.5], P[Y>3.5]
G. Qu
ENEE 324 Engineering Probability
21
Derived Random Variable Y=aX
Y=aX, where a>0
CDF: FY(y) = P[aX≤y] = P[X≤y/a] = FX(y/a)
PDF: fY(y) = (d/dy) FY(y) = (1/a) fX(y/a)
Special cases:
X: uniform (b,c)
Y: uniform (ab, ac)
X: exponential (λ)
Y: exponential (λ/a)
X: Erlang (n, λ)
Y: Erlang (n, λ/a)
X: Gaussian (µ,σ)
Y: Gaussian (aµ,aσ)
Y=aX, where a<0
CDF: FY(y) = P[aX≤y] = P[X≥y/a] = 1-FX(y/a)
PDF: fY(y) = (d/dy) FY(y) = -(1/a) fX(y/a)
G. Qu
ENEE 324 Engineering Probability
22
11
Derived Random Variable Y=X+b
Y=X+b
CDF: FY(y) = P[X+b≤y] = P[X≤y-b] = FX(y-b)
PDF: fY(y) = (d/dy) FY(y) = fX(y-b)
Y will be the same type of random variable as
X, with a shift of b to the right.
X: uniform (a,c)
Y: uniform (a+b, c+b)
X: exponential (λ)
Y: exponential (λ) for y≥b
X: Erlang (n, λ)
Y: Erlang (n, λ) for y≥b
X: Gaussian (µ,σ)
Y: Gaussian (µ,σ) for y≥b
G. Qu
ENEE 324 Engineering Probability
23
Example: Problem 3.7.10
X: a r.v. with CDF FX(x)
Y = 10 if x<0 and -10 if x≥0
Find FY(y)
If y<-10 P[Y≤y] = 0
If -10≤y<10, P[Y≤y] = P[x≥0] = 1-FX(0)
If y≥10, P[Y≤y] = 1
G. Qu
ENEE 324 Engineering Probability
24
12
Derived Random Variable from
Uniform (0,1)
U: uniform random variable between 0 and 1.
G(x) is a CDF for some r.v. and G has an
inverse G-1(.) defined on (0,1)
Y=G-1(U) for 0<U<1 is a derived r. v.
G(.) is a CDF, so G(x) ≥ G(x’) for x≥x’
CDF: FY(y) = P[G-1(U)≤y] = P[U≤G(y)] = G(y)
Examples 3.27 and 3.28.
Find function g that makes X=g(U) exponential (1).
Find function g that makes X=g(U) uniform (a,b).
G. Qu
ENEE 324 Engineering Probability
25
Conditional PDF and Expectation
X: random variable, P[B] >0 for an event B⊂SX
the conditional PDF of X given B is defined as
 f X ( x)

f X |B ( x) =  P[ B ]
 0
x∈B
x∉B
fX(x) = ∑ fX|Bi(x)P[Bi] for event space {B1,…}
E[X|B] = ∫ xfX|B(x)dx
Var[X|B]=E[X2|B] – E[X|B]2
E[g(X)] = ∫ g(x) fX|B(x)dx
G. Qu
ENEE 324 Engineering Probability
26
13
Example
W: the waiting time (in minutes) at a bus
stop for the next bus, is an exponential
random variable with λ = 0.2.
What is E[W]?
B={W≤10}, what is EW|B(w)?
P[B] = P[W≤10] = FW(10) = 1-e-2
fW|B(w) = 0.2e-0.2w/(1-e-2)
if w∈[0,10]; 0 o.w.
− 0 .2 w
EW|B(w) = ∫10 w × 0 . 2 e− 2
0
1− e
G. Qu
dw = 5 −
10
e2 −1
ENEE 324 Engineering Probability
27
Mixed Random Variables
CDF: FX(x) = P[X≤x]
Discrete r.v.: FX(x) is piecewise constant with
jumps (discontinuous)
PMF ⇒ (∑) CDF, E[X], Var[X], …
Continuous r.v.: FX(x) is continuous
CDF ⇒ (d/dx) PDF ⇒ (∫) CDF, E[X], Var[X], …
Mixed r.v.: FX(x) is piecewise continuous with
discountinuous
G. Qu
ENEE 324 Engineering Probability
28
14
Examples

0
 x  − a + 1
FX ( x) = 
 b − a +1
1

 0
y−a
FY ( y ) = 
b − a
 1
 0
 z − a
FZ ( z ) = 
 2(b − a )
 1
G. Qu
x<a
Are they CDFs?
a≤ x≤b
Non-negative
x>b
Non-decreasing
y<a
a≤ y≤b
y>b
z<a
a≤ z≤b
z >b
Reach 1
X: discrete
uniform (a,b)
Y: continuous
uniform (a,b)
Z: mixed
ENEE 324 Engineering Probability
29
Delta (δ) Function
Unit impulse (δ) function:
The limit of ∆n as n→∞
and dε as ε→0.
Sifting property: for any
continuous function g(x),
∫g(x) δ(x-c)dx = g(c)
where the integral goes
from -∞ to ∞ or a to b
with a<c<b.
0
if x < 0

ε
/2 1
∫−∞ δ (v)dv = lim∫−ε / 2 dv = 1 if x ≥ 0
ε
 ε →0
x
G. Qu
0 x ≠ 0
∞ x = 0
δ ( x) = 
∫
∞
−∞
δ ( x)dx = 1

0
∆n (x) = 
n

0

dε (x) = 1
ε
ENEE 324 Engineering Probability
| x |>
−
1
2n
1
1
≤x≤
2n
2n
| x |> ε2
ε
ε
− ≤x≤
2
2
30
15
Unit Step Function
Definition
∫ δ(v)dv = u(x) ⇒du/dx= δ(x)
x<0
x≥0
0
u ( x) = 
1
For discrete random variable X:
FX(x) = ∑xi∈Sx PX(xi) = ∑xi∈Sx PX(xi)u(x-xi)
Define fX(x)=(d/dx)(FX(x)=∑xi∈Sx PX(xi) δ(x-xi)
∫xfT(t)dt = ∑xi∈Sx PX(xi) ∫xδ(t-xi)dt = ∑xi∈Sx
PX(xi)u(x-xi) = ∑xi∈Sx PX(xi) = FX(x)
∫ xfX(x)dx = ∑xi∈Sx{PX(xi)(∫xδ(x-xi)dx)} =
∑xi∈SxPX(xi) xi= E[X] recall: ∫g(x) δ(x-c)dx = g(c)
fX(x) can be considered as the PDF of X.
G. Qu
ENEE 324 Engineering Probability
31
Mixed Random Variables
X is a mixed r.v. iff fX(x) contains both
impulses and non-zero finite values.
draw fX(x) with impulses: a ↑ at x, where the
impulse occurs, with value PX(x) at the arrowhead.
Example 3.19*: Y takes values 1,2,3 with
probabilities 1/2, 1/3, and 1/6.
Draw PMF, CDF, and PDF of Y
1/2
G. Qu
ENEE 324 Engineering Probability
1/3
1/6
32
16
Example 3.21
Y is the length of a phone call. Line is busy
or no answer with 1/3; otherwise Y is
uniformly distributed between 0 and 3
minutes.
CDF: FY(y)=(1/3)u(y) + (1/3+2y/9) (0≤y≤3)
PDF: fY(y)=(1/3)δ(y)+2/9
E[Y] = 1
G. Qu
 0
 1

FY ( y ) =  1 3 2
3 + 3
 1
(0≤y≤3)
y<0
y
3
y=0
0≤ y<3
y≥3
ENEE 324 Engineering Probability
33
In-class Quiz
Given the CDF of a random variable X
 0
x + 2
FX ( x) = 
 4
 1
x < −1
−1 ≤ x < 1
x ≥1
What type of r.v. X is?
What is P[X≤0]?
What is P[X=-1]?
Find the PDF fX(x).
G. Qu
ENEE 324 Engineering Probability
34
17
Related documents