{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

midterm-solution

# midterm-solution - we can get c = 2 e Rejection algorithm...

This preview shows pages 1–3. Sign up to view the full content.

Midterm Exam Solution 1 Problem 1 1) T 2) F 3) F 2 Problem 2 1) a 2) a 3) b 4) a 3 Problem 3 1) 1/c. 2) One possible answer is 2 π (1+ x 2 ) , x > 0. It is the density of | X | , where X Cauchy. 3) x=rnorm(10,1,3), mean(x), var(x). 4) 1 4 × 3 × 3 × 2 = 1 72 , 1 4 × 3 × 3 × 3 = 1 108 . 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
5) dhyper (2 , 2 , 2 , 3) × dhyper (1 , 1 , 1 , 1) = 2 2 2 1 4 3 × 1 1 1 0 2 1 = 1 4 . 4 Problem 4 The CDF is F ( t ) = Z t β α β α x α +1 dx = β α ( - x - α ) | x = t x = β = β α ( β - α - t - α ) = 1 - ( β t ) α , so t = F - 1 ( u ) = β (1 - u ) 1 α Inverse CDF algorithm: step1: Draw u Uniform (0 , 1) step2: x = F - 1 ( u ), then x will follow the target distribution. 5 Problem 5 Let l ( x ) = e 1 x , x [1 , 3], then max ( l ( x )) = e . If we choose uniform(1,3) as our pro- posal distribution, then g ( x ) = 1 2 . From l ( x ) cg
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ), we can get c = 2 e . Rejection algorithm: step1: Generate x ∼ Uniform (1 , 3). 2 step2: Generate u ∼ Uniform (0 , 1). step3: Accept x if u ≤ l ( x ) cg ( x ) = e 1 x-1 . 6 Problem 6 let l ( x ) = e-x e-e-x and h ( x ) = x . We can choose gamma(2,1) as our proposal distribution, so g ( x ) = xe-x , x > 0. Then the IS algorithm is: step1: Draw x ( i ) ∼ gamma (2 , 1) ,i = 1 , 2 ,...,n . step2: Calculate weights w ( i ) = e-x ( i ) e-e-x ( i ) x ( i ) e-x ( i ) = e-e-x ( i ) x ( i ) . step3: Estimate μ by ˆ μ = ∑ n i =1 w ( i ) h ( x ( i ) ) ∑ n i =1 w ( i ) . 3...
View Full Document

{[ snackBarMessage ]}