lecture 2 inverse cdf method today s lecture
play

Lecture 2: Inverse CDF method Todays lecture In this lecture we look - PowerPoint PPT Presentation

Lecture 2: Inverse CDF method Todays lecture In this lecture we look at the inverse CDF method for simulating from continuous random variables. The inverse CDF method This is a method for simulating univariate continuous random variables Let


  1. Lecture 2: Inverse CDF method

  2. Today’s lecture In this lecture we look at the inverse CDF method for simulating from continuous random variables.

  3. The inverse CDF method This is a method for simulating univariate continuous random variables Let U ∼ U (0 , 1) Suppose F ( x ) is a well-defined CDF which is invertible Then the random variable X = F − 1 ( U ) has CDF F ( x )

  4. The inverse CDF method X = F − 1 ( U ) . So � F − 1 ( U ) ≤ x � Pr ( X ≤ x ) = Pr � F ( F − 1 ( U )) ≤ F ( x ) � = Pr = Pr ( U ≤ F ( x )) = F ( x ) , since 0 ≤ F ( x ) ≤ 1 (see sketch on board).

  5. The inverse CDF method X = F − 1 ( U ) . So � F − 1 ( U ) ≤ x � Pr ( X ≤ x ) = Pr � F ( F − 1 ( U )) ≤ F ( x ) � = Pr = Pr ( U ≤ F ( x )) = F ( x ) , since 0 ≤ F ( x ) ≤ 1 (see sketch on board).

  6. The inverse CDF method X = F − 1 ( U ) . So � F − 1 ( U ) ≤ x � Pr ( X ≤ x ) = Pr � F ( F − 1 ( U )) ≤ F ( x ) � = Pr = Pr ( U ≤ F ( x )) = F ( x ) , since 0 ≤ F ( x ) ≤ 1 (see sketch on board).

  7. The inverse CDF method X = F − 1 ( U ) . So � F − 1 ( U ) ≤ x � Pr ( X ≤ x ) = Pr � F ( F − 1 ( U )) ≤ F ( x ) � = Pr = Pr ( U ≤ F ( x )) = F ( x ) , since 0 ≤ F ( x ) ≤ 1 (see sketch on board).

  8. The inverse CDF method X = F − 1 ( U ) . So � F − 1 ( U ) ≤ x � Pr ( X ≤ x ) = Pr � F ( F − 1 ( U )) ≤ F ( x ) � = Pr = Pr ( U ≤ F ( x )) = F ( x ) , since 0 ≤ F ( x ) ≤ 1 (see sketch on board).

  9. The inverse CDF method Example Suppose we obtain two observations from a U (0 , 1) distribution: 0 . 1 and 0 . 85. Use these values to obtain two observations from X ∼ Exp (2).

  10. Solution If X ∼ Exp (2) then F X ( x ) = 1 − e − 2 x . If y = 1 − e − 2 x , then e − 2 x = 1 − y − 2 x = log(1 − y ) − 1 x = 2 log(1 − y ) . Plug in y = 0 . 1 and y = 0 . 85; gives realized values of 0 . 0527 and 0 . 949.

  11. Solution If X ∼ Exp (2) then F X ( x ) = 1 − e − 2 x . If y = 1 − e − 2 x , then e − 2 x = 1 − y − 2 x = log(1 − y ) − 1 x = 2 log(1 − y ) . Plug in y = 0 . 1 and y = 0 . 85; gives realized values of 0 . 0527 and 0 . 949.

  12. Solution If X ∼ Exp (2) then F X ( x ) = 1 − e − 2 x . If y = 1 − e − 2 x , then e − 2 x = 1 − y − 2 x = log(1 − y ) − 1 x = 2 log(1 − y ) . Plug in y = 0 . 1 and y = 0 . 85; gives realized values of 0 . 0527 and 0 . 949.

  13. Example Patients arriving at a doctor’s surgery have appointment times 15 minutes apart. The random variable L measures how late a patient is for his/her appointment, with negative values denoting early arrivals. The PDF of L is � 0 . 0025( ℓ + 20) , − 20 ≤ ℓ ≤ 0 , f L ( ℓ ) = 0 . 05 e − ℓ/ 10 , ℓ > 0 .

  14. Questions a. Sketch f L ( ℓ ). b. Show that the CDF of L is  0 , ℓ < − 20 ,   0 . 00125( ℓ + 20) 2 , F L ( ℓ ) = − 20 ≤ ℓ ≤ 0 , 1 − e − ℓ/ 10  , ℓ > 0 .  2 c. Suppose that 0 . 205 and 0 . 713 are two realized values of U ∼ U (0 , 1). Show that the corresponding realized values of L are − 7 . 19 and 5 . 55 under the inverse CDF simulation method.

  15. Solution First, the PDF: f L ( l ) 0.05 − 20 0 l

  16. Solution Now to find the CDF: L lies between − 20 and + ∞ , so F L ( ℓ ) = 0 when ℓ < − 20. For − 20 ≤ ℓ ≤ 0: � ℓ F L ( ℓ ) = f L ( s ) ds − 20 � ℓ = 0 . 0025( s + 20) ds − 20 � ℓ � 0 . 0025 ( s + 20) 2 = 2 − 20 0 . 00125( ℓ + 20) 2 = for − 20 ≤ ℓ ≤ 0 . Also, F L (0) = 0 . 5.

  17. Solution Now to find the CDF: L lies between − 20 and + ∞ , so F L ( ℓ ) = 0 when ℓ < − 20. For − 20 ≤ ℓ ≤ 0: � ℓ F L ( ℓ ) = f L ( s ) ds − 20 � ℓ = 0 . 0025( s + 20) ds − 20 � ℓ � 0 . 0025 ( s + 20) 2 = 2 − 20 0 . 00125( ℓ + 20) 2 = for − 20 ≤ ℓ ≤ 0 . Also, F L (0) = 0 . 5.

  18. Solution Now to find the CDF: L lies between − 20 and + ∞ , so F L ( ℓ ) = 0 when ℓ < − 20. For − 20 ≤ ℓ ≤ 0: � ℓ F L ( ℓ ) = f L ( s ) ds − 20 � ℓ = 0 . 0025( s + 20) ds − 20 � ℓ � 0 . 0025 ( s + 20) 2 = 2 − 20 0 . 00125( ℓ + 20) 2 = for − 20 ≤ ℓ ≤ 0 . Also, F L (0) = 0 . 5.

  19. Solution Now to find the CDF: L lies between − 20 and + ∞ , so F L ( ℓ ) = 0 when ℓ < − 20. For − 20 ≤ ℓ ≤ 0: � ℓ F L ( ℓ ) = f L ( s ) ds − 20 � ℓ = 0 . 0025( s + 20) ds − 20 � ℓ � 0 . 0025 ( s + 20) 2 = 2 − 20 0 . 00125( ℓ + 20) 2 = for − 20 ≤ ℓ ≤ 0 . Also, F L (0) = 0 . 5.

  20. Solution Now to find the CDF: L lies between − 20 and + ∞ , so F L ( ℓ ) = 0 when ℓ < − 20. For − 20 ≤ ℓ ≤ 0: � ℓ F L ( ℓ ) = f L ( s ) ds − 20 � ℓ = 0 . 0025( s + 20) ds − 20 � ℓ � 0 . 0025 ( s + 20) 2 = 2 − 20 0 . 00125( ℓ + 20) 2 = for − 20 ≤ ℓ ≤ 0 . Also, F L (0) = 0 . 5.

  21. Solution Now to find the CDF: L lies between − 20 and + ∞ , so F L ( ℓ ) = 0 when ℓ < − 20. For − 20 ≤ ℓ ≤ 0: � ℓ F L ( ℓ ) = f L ( s ) ds − 20 � ℓ = 0 . 0025( s + 20) ds − 20 � ℓ � 0 . 0025 ( s + 20) 2 = 2 − 20 0 . 00125( ℓ + 20) 2 = for − 20 ≤ ℓ ≤ 0 . Also, F L (0) = 0 . 5.

  22. Solution Now to find the CDF: L lies between − 20 and + ∞ , so F L ( ℓ ) = 0 when ℓ < − 20. For − 20 ≤ ℓ ≤ 0: � ℓ F L ( ℓ ) = f L ( s ) ds − 20 � ℓ = 0 . 0025( s + 20) ds − 20 � ℓ � 0 . 0025 ( s + 20) 2 = 2 − 20 0 . 00125( ℓ + 20) 2 = for − 20 ≤ ℓ ≤ 0 . Also, F L (0) = 0 . 5.

  23. Solution Now � 0 � ℓ F L ( ℓ ) = f L ( s ) ds + f L ( s ) ds for ℓ > 0 − 20 0 � ℓ 0 . 05 e − s / 10 ds = 0 . 5 + 0 0 . 05 × − 10 e − s / 10 � ℓ � = 0 . 5 + 0 0 . 5 + 0 . 5 − 0 . 5 e − ℓ/ 10 = 1 − e − ℓ/ 10 = as required. , 2

  24. Solution Now � 0 � ℓ F L ( ℓ ) = f L ( s ) ds + f L ( s ) ds for ℓ > 0 − 20 0 � ℓ 0 . 05 e − s / 10 ds = 0 . 5 + 0 0 . 05 × − 10 e − s / 10 � ℓ � = 0 . 5 + 0 0 . 5 + 0 . 5 − 0 . 5 e − ℓ/ 10 = 1 − e − ℓ/ 10 = as required. , 2

  25. Solution Now � 0 � ℓ F L ( ℓ ) = f L ( s ) ds + f L ( s ) ds for ℓ > 0 − 20 0 � ℓ 0 . 05 e − s / 10 ds = 0 . 5 + 0 0 . 05 × − 10 e − s / 10 � ℓ � = 0 . 5 + 0 0 . 5 + 0 . 5 − 0 . 5 e − ℓ/ 10 = 1 − e − ℓ/ 10 = as required. , 2

  26. Solution Now � 0 � ℓ F L ( ℓ ) = f L ( s ) ds + f L ( s ) ds for ℓ > 0 − 20 0 � ℓ 0 . 05 e − s / 10 ds = 0 . 5 + 0 0 . 05 × − 10 e − s / 10 � ℓ � = 0 . 5 + 0 0 . 5 + 0 . 5 − 0 . 5 e − ℓ/ 10 = 1 − e − ℓ/ 10 = as required. , 2

  27. Solution Now � 0 � ℓ F L ( ℓ ) = f L ( s ) ds + f L ( s ) ds for ℓ > 0 − 20 0 � ℓ 0 . 05 e − s / 10 ds = 0 . 5 + 0 0 . 05 × − 10 e − s / 10 � ℓ � = 0 . 5 + 0 0 . 5 + 0 . 5 − 0 . 5 e − ℓ/ 10 = 1 − e − ℓ/ 10 = as required. , 2

  28. Solution Now for some realized values: u = 0 . 205 < 0 . 5, so realized value ℓ lies between − 20 and 0. Thus F L ( ℓ ) = 0 . 00125( ℓ + 20) 2 . Find the inverse, and evaluate at u = 0 . 205: 0 . 00125( ℓ + 20) 2 , = so y � y = 0 . 00125 − 20 , ℓ ± giving � 0 . 205 ℓ = 0 . 00125 − 20 = − 7 . 2 .

  29. Solution Now for some realized values: u = 0 . 205 < 0 . 5, so realized value ℓ lies between − 20 and 0. Thus F L ( ℓ ) = 0 . 00125( ℓ + 20) 2 . Find the inverse, and evaluate at u = 0 . 205: 0 . 00125( ℓ + 20) 2 , = so y � y = 0 . 00125 − 20 , ℓ ± giving � 0 . 205 ℓ = 0 . 00125 − 20 = − 7 . 2 .

  30. Solution Now for some realized values: u = 0 . 205 < 0 . 5, so realized value ℓ lies between − 20 and 0. Thus F L ( ℓ ) = 0 . 00125( ℓ + 20) 2 . Find the inverse, and evaluate at u = 0 . 205: 0 . 00125( ℓ + 20) 2 , = so y � y = 0 . 00125 − 20 , ℓ ± giving � 0 . 205 ℓ = 0 . 00125 − 20 = − 7 . 2 .

  31. Solution Now for some realized values: u = 0 . 205 < 0 . 5, so realized value ℓ lies between − 20 and 0. Thus F L ( ℓ ) = 0 . 00125( ℓ + 20) 2 . Find the inverse, and evaluate at u = 0 . 205: 0 . 00125( ℓ + 20) 2 , = so y � y = 0 . 00125 − 20 , ℓ ± giving � 0 . 205 ℓ = 0 . 00125 − 20 = − 7 . 2 .

  32. Solution Now for some realized values: u = 0 . 205 < 0 . 5, so realized value ℓ lies between − 20 and 0. Thus F L ( ℓ ) = 0 . 00125( ℓ + 20) 2 . Find the inverse, and evaluate at u = 0 . 205: 0 . 00125( ℓ + 20) 2 , = so y � y = 0 . 00125 − 20 , ℓ ± giving � 0 . 205 ℓ = 0 . 00125 − 20 = − 7 . 2 .

  33. Solution Now for some realized values: u = 0 . 205 < 0 . 5, so realized value ℓ lies between − 20 and 0. Thus F L ( ℓ ) = 0 . 00125( ℓ + 20) 2 . Find the inverse, and evaluate at u = 0 . 205: 0 . 00125( ℓ + 20) 2 , = so y � y = 0 . 00125 − 20 , ℓ ± giving � 0 . 205 ℓ = 0 . 00125 − 20 = − 7 . 2 .

  34. Solution Now for some realized values: u = 0 . 205 < 0 . 5, so realized value ℓ lies between − 20 and 0. Thus F L ( ℓ ) = 0 . 00125( ℓ + 20) 2 . Find the inverse, and evaluate at u = 0 . 205: 0 . 00125( ℓ + 20) 2 , = so y � y = 0 . 00125 − 20 , ℓ ± giving � 0 . 205 ℓ = 0 . 00125 − 20 = − 7 . 2 .

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend