Lecture Note 4
Lecture Note 4
Statistical Simulations
Random Variates
Acceptance/rejection method
Composition method
Convolution method
Inverse Transformation Technique
Most useful when the CDF F(x) has an inverse F -1(x) which is
easy to compute.
Inverse Transformation Technique cont…
Required steps
Example:
Inverse Transformation Technique contd...
Example cont…
Consider the case a = 1, The cdf for x > 0 is
F (x) = 1 - exp(-x).
Two random variates has been generated using Equation 2.
Example:
𝑥 Τ2 , 0≤𝑥<1
1Τ2 , 1≤𝑥<2
𝑓 𝑥 =
(3 − 𝑥)Τ2 , 2≤𝑥<3
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Inverse Transformation Technique contd...
Answer:
For 0 ≤ 𝑥 < 1,
𝑥
𝑡 𝑥2
𝐹 𝑥 = 𝐹1 𝑥 = න 𝑑𝑡 =
0 2 4
Inverse Transformation Technique contd...
For 1 ≤ 𝑥 < 2,
𝑥
1
𝐹 𝑥 = 𝐹2 𝑥 = 𝐹 1 + න 𝑑𝑡
1 2
1 (𝑥 − 1)
= +
4 2
For 2 ≤ 𝑥 < 3
𝑥
3−𝑡
𝐹 𝑥 = 𝐹3 𝑥 = 𝐹 2 + න 𝑑𝑡
2 2
3−𝑥 2
=1−
4
Inverse Transformation Technique contd...
• else,
Example:
0.1 , 𝑥=1
𝑓 𝑥 = ቐ0.3 , 𝑥=2
0.6 , 𝑥=3
Inverse Transformation Technique contd...
Answer:
0, 𝑥<0
0.1, 1≤𝑥<2
𝐹 𝑥 =
0.4, 2≤𝑥<3
1.0, 3≤𝑥
If 0 ≤ 𝑈𝑖 ≤ 0.1, then 𝑥𝑖 = 1
elseIf 0.1 ≤ 𝑈𝑖 ≤ 0.4, then 𝑥𝑖 = 2
Else 0.4 ≤ 𝑈𝑖 ≤ 1.0, then 𝑥𝑖 = 3
Inverse Transformation Technique contd...
Algorithm:
X 1 2 3 ……….. j -1 j …..…… N
3.6 = 3
Inverse Transformation Technique contd...
𝑃 𝑋=𝑥 = 𝑛𝐶 𝑃 𝑥 1−𝑃 𝑛 _𝑥
𝑥
= 𝑛!
𝑥 𝑛_𝑥
𝑥! 𝑛−𝑥 ! 𝑃 1−𝑃
Inverse Transformation Technique contd...
𝑋 = 𝑌𝑖 ,
𝑖=1
Example:
X ∼ Bin(4, 0.25). The possible values of X are xi = i, i = 0, ..., 4, and
the values of F are given in the Table .
Suppose U = 0.6122 is a given random number.
Looking along the rows of F (xi) values, we see that
F (x0) = 0.3164 < U = 0.6122 < F (x1) = 0.7383.
Thus x1 is the first xi such that U ≤ F (xi); therefore X = 1
Inverse Transformation Technique contd...
• The data in the previous example is restricted in the range 0.25 ≤ X ≤ 2.0
• The underlying distribution might have a wider range .
• Thus, try to find a theoretical distribution.
Inverse Transformation Technique contd...
1
, 𝑎≤𝑥<𝑏
𝑓 𝑥 =൝ 𝑏−𝑎
0 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Inverse Transformation Technique contd...
CDF;
𝑥
1
𝐹 𝑥 =න 𝑑𝑥
𝑏−𝑎
0
𝑥
1
= 𝑥ቤ
𝑏−𝑎 𝑎
𝑥−𝑎
𝐹 𝑥 =
𝑏−𝑎
𝒙𝒊 = 𝒂 + 𝒃 − 𝒂 𝑹𝒊
Inverse Transformation Technique contd...
𝑥
1 −𝛽
𝑒 ;𝑥 >0
𝛽
𝑓(𝑥) =
0 ; o/w
Inverse Transformation Technique contd...
𝑥
1 −𝛽𝑥
𝐹 𝑥 = න 𝑒 𝑑𝑥
𝛽
0
𝑥 𝑥
−
1𝑒 𝛽
= อ
𝛽 −1
𝛽
0
𝑥 𝑥
−𝛽 −𝛽 −𝛽
𝐹 𝑥 = × 𝑒 − 𝑒 −0 = 1 − 𝑒
𝛽
𝑥
−𝛽
𝐹 𝑥 = ൝1 − 𝑒 ;𝑥 > 0
0 ; 𝑜/𝑤
Inverse Transformation Technique contd...
𝑥
−
𝐹 𝑥 =1 − 𝑒 𝛽 =𝑢
𝑥
−
𝑒 𝛽 =1−𝑢
𝑥
− = 𝑙𝑛 1 − 𝑢
𝛽
𝑥 = −𝛽𝑙𝑛(1 − 𝑢)
𝒙 = −𝜷 𝐥𝐧 𝒖
Inverse Transformation Technique contd...
• Plot the two as a point in the plane and represent them in a polar
coordinate system as,
𝑍1 = 𝐵 cos𝜃
𝑍2 = 𝐵 sin𝜃
Inverse Transformation Technique contd...
𝑌 = 𝜆𝑒 −𝜆𝑡 , 𝑡 ≥ 0
𝐸[𝑌] = 2 = 𝜆
𝐵 = −2 𝑙𝑛 𝑅
Inverse Transformation Technique contd...
• So a normal distribution can be generated by any one of the
following.
𝑍1 = −2 𝑙𝑛 𝑅1cos(2𝜋𝑅2)
𝑍2 = −2 𝑙𝑛 𝑅1sin(2𝜋𝑅2)