17 views

Uploaded by Stephen Downing

Accept-Reject sampling method derivation and computation in R

- 8-2-CRN
- stochastic modelling
- D1 Jun 03 MS(2)
- WAJ 3105 -Exercise
- Solving Np-hard Problem Using Artificial Bee Colony Algorithm
- Cauchy Riemann Equations
- X504 BA Schedule 2015
- ot - Copy
- Dissolution Template
- fifty years rainfall data of nsukka
- Proposal Review DecADSision Matrix
- acs set 2
- HSE-II Mathematics Guess (2)
- DSTL Job Profile 22916
- Optimasi Tugas1Faizal Hadi P 145060201111015 Xx
- Volatile components in banana.pdf
- Advanced Algorithms and Data Structures_L6
- BijanWhite_MarketingData.pdf
- Heat
- SEMINARIO_3

You are on page 1of 3

Homework 3

Stephen Downing

14 March 2014

3.1 Question 1

3.1.1 (a)

Since Y has a density g(y), then calculating the marginal (i.e., not conditioned on P(U

f(Y )

cg(Y )

) but originating from the geometric distribution) probability p for an accepted rv yields

(from [1]):

p =

f(y)

cg(y)

g(y)dy (1)

=

1

c

f(y)dy

=

1

c

The probability of acceptance is thus

1

c

.

3.1.2 (b)

The expected number of trials until acceptance is E(N) = c. Additionally, since the number

of rejections should be minimized for computational eciency, c should be the smallest value

that satises the e bounded inequality 0 <

f(Y )

cg(Y )

1, which is the minimum c such that

cg(x) still majorizes f(x): c = sup

x

{

f(x)

g(x)

}.

3.1.3 (c)

Assume the cdf of the rv X, F(X) = P(X x), is unknown. Denote the suitable proposal

rv to be used in the Acceptance-Rejection (A-R) algorithm Y G (i.e., Y follows the

distribution G), along with U u

[0,1]

, and some constant c that satises:

U

1

c

f(X)

g(X)

.

1

Let A = Y y, the total area (or density) in which the second uniform deviate can be

located, and B = U

f(Y )

cg(Y )

, the acceptance region with B A. Given that Bayes Theorem

tells us P(A|B) = [P(B|A)P(A)]/P(B), and knowing P(B) = p =

1

c

, then we can show

that the conditional distribution of Y given U

f(Y )

cg(Y )

actually follows the distribution from

which we intended to sample, Y F, and therefore has the same distribution as the accepted

sample X. First we simplify the conditional probability (e.g., by [1], [2]).

P(U

f(y)

cg(y)

|Y y) =

P(U

f(Y )

cg(Y )

, Y y)

G(y)

(2)

=

P(U

f(Y )

cg(Y )

|Y = w y)

G(y)

g(w)dw

=

1

G(y)

f(w)

cg(w)

g(w)dw

=

1

cG(y)

f(w)dw

=

F(y)

cG(y)

And then this result is used [1] to show the conditional distribution of Y is F:

P(U

f(y)

cg(y)

|Y y)

G(y)

1/c

=

F(y)

cG(y)

cG(Y )

1/c

(3)

= F(y).

3.2 Question 2

3.2.1 (a)

The A-R algorithm involves selecting pairs of rvs (X, U), whereby the X drawn from the

proposal distribution that is proportional to the distribution from which we are simulating

the sample and the U to determine whether to accept or reject. It can be illustrative to

explain the steps of the A-R algorithm in terms of a two-dimensional graph on which the

rv tuples represent coordinates [3]. All points that fall in the area where Ucg(x) f(x)

are accepted while those points where Ucg(x) > f(x) are rejected. The A-R algorithm for

generating 1000 deviates from a gamma distribution employing a mixture density in the

majorizing function h(x) = cg(x) is as follows [4]:

(1) While the accepted deviates are less than 1000; generate u

1

u

[0,1]

; set b =

(e+)

e

(e Eulers constant); set p = u

1

b

(1.1) If p 1 go to (2)

(1.2) If p > 1 go to (3)

(2) Set x = p

(1/)

; generate u

2

u

[0,1]

(2.1) If u

2

e

x

, accept u

2

; increment gamma deviate counter

(2.2) Otherwise, reject; go to (1)

2

(3) Set x = log(b ()); generate u

2

u

[0,1]

(3.1) If u

2

x

1

, accept u

2

; increment gamma deviate counter

(3.2) Otherwise, reject; go to (1)

(4) increment iteration counter; go to (1).

3.2.2 (b)

According to [4](p.213-214), given that the sampling mixture q(x) dictates that bu u

[0,1]

when bu 1 and

(e+)ue

u

[0,1]

when bu > 1, then the expected number of iterations per

accepted deviate is E[j] = (e +)[e()]. Using = 0.8 the expected number of iterations

per acceptance c = 8.907 and the accepted ratio

1

c

= 0.112.

3.2.3 (c)

To compare the A-R generated sample with the R function for gamma distribution:

- - - 10% 20% 30% 40% 50% 60% 70% 80% 90%

Qsamp 0.07 0.14 0.21 0.28 0.36 0.43 0.52 0.63 0.75

Qhat 0.04 0.14 0.25 0.36 0.50 0.71 0.99 1.36 2.03

References

[1] Sigman, Karl, Acceptance-Rejection Method, Columbia University, 2007

[2] Robert, Christian P. and Casella, George, Introducing Monte Carlo Methods with R,

Springer, New York, NY, 2010

[3] Press, William H., Flannery, Brian P., Teukolsky, Saul A., and Vetterling, William T.,

Numerical Recipes in C: The Art of Scientic Computing, 2nd Ed., University of Cam-

bridge Press, Cambridge, 1992

[4] Kennedy, Jr., William J. and Gentle, James E., Statistical Computing, Marcel Dekker,

Inc., New York, NY, 1980.

3

- 8-2-CRNUploaded by詹禮豪
- stochastic modellingUploaded bySaket Verma
- D1 Jun 03 MS(2)Uploaded byKasra Ansari
- WAJ 3105 -ExerciseUploaded byRobyn Brown
- Solving Np-hard Problem Using Artificial Bee Colony AlgorithmUploaded byIAEME Publication
- Cauchy Riemann EquationsUploaded byAtom VonDudang
- X504 BA Schedule 2015Uploaded byjerome
- ot - CopyUploaded bygaurav503050
- Dissolution TemplateUploaded bylkglaxman
- fifty years rainfall data of nsukkaUploaded byoloche ekwule
- Proposal Review DecADSision MatrixUploaded byAllan V. Valente
- acs set 2Uploaded byswathik_naidu
- HSE-II Mathematics Guess (2)Uploaded byFirdous Ahmad
- DSTL Job Profile 22916Uploaded bySpin Watch
- Optimasi Tugas1Faizal Hadi P 145060201111015 XxUploaded bySanri Teknik
- Volatile components in banana.pdfUploaded byUroborosz
- Advanced Algorithms and Data Structures_L6Uploaded byBasem Ajjan
- BijanWhite_MarketingData.pdfUploaded byAnonymous G5pdoEW
- HeatUploaded bySirilak Klakwong
- SEMINARIO_3Uploaded bykkkprot
- Homework 1Uploaded byHo-Shing Chau
- 1069Uploaded byBikash Gaurav Bhuyan
- Full TextUploaded bybuggrraa
- US Federal Reserve: Appendixn18Uploaded byThe Fed
- AbstractUploaded byAnonymous QIuAGIadXm
- 2005 ASMS - Poster - Metabolite ID and Metabolic Stability on LTQUploaded bymr_jpwalsh8941
- A level Mathematics Practice Paper D – Pure Mathematics.docxUploaded byZaka Ahmed
- SOA 2001.05 Exam 1-P SolutionsUploaded byZay Lia
- emdUploaded byMaryam Saeed
- Solution Last Prob TretrafUploaded bySean Kevin

- Microeconomics for Business Quiz 4 SolutionsUploaded byStephen Downing
- Accept-Reject sampling method derivation and computation in RUploaded byStephen Downing
- Solutions Chapter 2Uploaded byTimroo Hamro
- Examining "Borrowed Theory" in Original vs. New Disciplines via Text MiningUploaded byStephen Downing
- Strategy: An Introduction to Game Theory (Second Ed) Instructor's ManualUploaded byStephen Downing
- Writ 101 Essay 3Uploaded byStephen Downing

- saleem Printer Notes New 11Uploaded byPrince Saleem
- Non-Destructive Evaluation of Railway Track Using Ground Penetrating RadarUploaded bydtexion
- Datasheet Bettis Bgi UsUploaded byjuananbu76
- Accuracy and Quality Comparison of Orthorectified High Resolution Satellite ImagesUploaded byAndreas Georgopoulos
- Schrodinger Eq PptUploaded byHaroon Saeed
- Dryness Fraction of Steam ExpUploaded byAthina
- 109300227-2964-CONSORT-2010-ChecklistUploaded bySri Wahyudi
- Cnetcam2 Full Manual EngUploaded byVlado Lupčo
- 3. Local Buckling and Cross-section ClassificationUploaded byLouis Lai
- Why Use Embedded Linux for Real Time Embedded Systems Rev AUploaded byJoemon John Kurishumootill
- Frequency ReuseUploaded byTry Lang
- Essbase Studio Tutorial by Example Part1Uploaded bypraveenkumarvi5381
- The Heuristic Structure ofUploaded bycésar_jurado_2
- 11-SparkWorkingWithRDDs.pdfUploaded byPetter P
- Mcs1800 PresentationUploaded byHoang Minh Tien
- Parrhesia 19Uploaded byKoutsoupis
- Smart Pressure TransmitterUploaded byNAYEEM
- C++ Solved ProblemsUploaded bytedros
- ts_132425v080800pUploaded bygolden_hunter_1980
- Manheim-North-American-Lo...pdfUploaded byowdkasld
- NN-Ch2Uploaded byPrasanth Shivanandam
- Https Communities.bentleyUploaded by2009tamer6138
- Fugative EmmissionUploaded byAhmed Mansour
- 33-111-1-PB.pdfUploaded byviolinvinzy
- Solenoid Operated Directional Control Valves Form 1008705 Rev 7-12Uploaded byInggani Masitha
- Program ICMIC2016Uploaded byZellagui Energy
- AppleUploaded byXiaomi Xao
- Ducati 1198 Technical SpecificationUploaded byPaul
- 4.Ijaest Vol No 10 Issue No 1 Design of 1 Bit Full Adder for Low Power Applications 019 025Uploaded byPraveer Saxena
- olivier2008.pdfUploaded byjjsarazucotrina