next up previous

STAT 380 Lecture 26

Example: Half normal distribution: X has density

displaymath67

(Density of absolute value of N(0,1).)

Use tex2html_wrap_inline71 . To find c maximize

displaymath75

Rewrite as

displaymath77

Maximum is at x=a giving

displaymath81

Choose a to minimize c (or tex2html_wrap_inline87 ); get a=1 so

displaymath91

Algorithm is then: generate tex2html_wrap_inline93 and then compute

displaymath95

Generate tex2html_wrap_inline97 and if

displaymath99

accept Y otherwise try again.

To generate N(0,1): use a third U to pick a sign at random: negative if u < 1/2 otherwise positive.

Discrete Distributions

The inverse transformation method works for discrete distributions.

X has possible values tex2html_wrap_inline111 with probabilities tex2html_wrap_inline113 compute cumulative probabilities

displaymath115

with tex2html_wrap_inline117 .

Generate tex2html_wrap_inline119 Uniform(0,1).

Find k such that

displaymath123

Put tex2html_wrap_inline125 .


next up previous



Richard Lockhart
Wednesday November 29 13:15:40 PST 2000