12_Sim_Hw5_Sol

# 12_Sim_Hw5_Sol - IEOR 4404 Assignment #5 Solutions...

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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: IEOR 4404 Assignment #5 Solutions Simulation February 20, 2012 Prof. Mariana Olvera-Cravioto Page 1 of 4 Assignment #5 Solutions 1. First note that an immediate algorithm is to generate an exponential random variable X with rate 1, and return X whenever X < . 05. Doing so is inefficient, however, because the probability of the event { X < . 05 } is small. (Indeed, P ( X < . 05) = 1- e- . 5 .) Instead, we can use the inverse transform method. Let Y [ X | X < . 05]. The cumulative distribution function of Y is given by F ( y ) = P [ Y y ] = P [ X y | X < . 05] = Z y f ( u ) du = 1 1- e- . 05 (1- e- y ) , for 0 < y < . 05. The inverse of this function is given by F- 1 ( y ) =- ln(1- (1- e- . 05 ) y ) . With this, we can implement the inverse transform method to generate Y . The steps of the algorithm are the following: STEP 1. Generate a random number U , uniform on [0 , 1]. STEP 2. Return Y = F- 1 ( U ) =- ln(1- (1- e- . 05 ) U ). The following MATLAB code can be used for estimating E [ X | X < . 05]: >> rand(state,0); >> S=0; >> for i=1:1000 S=S-log(1-rand(1)*( 1-exp(-0.05) ) ); end >> S/1000 ans = 0.0249 The exact value of E [ X | X < . 05] can be computed as follows: E [ X | X < . 05] = Z . 05 xf ( x ) dx = Z . 05 x e- x 1- e- . 05 dx = 1- 1 . 05 e- . 05 1- e- . 05 , where we compute the integral using integration by parts. 2 IEOR 4404, Assignment #5 Solutions 2. We wish to generate X by using the acceptance rejection algorithm with an exponential random variable Y with rate . That is, Y has density...
View Full Document

## This note was uploaded on 03/18/2012 for the course IEOR 4404 taught by Professor C during the Spring '10 term at Columbia.

### Page1 / 4

12_Sim_Hw5_Sol - IEOR 4404 Assignment #5 Solutions...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online