4.4. The Wichmann-Hill (1982) pseudo-random number generator can be defined in FORTRAN as real function wh(x,y,z) integer

Question:

4.4. The Wichmann-Hill (1982) pseudo-random number generator can be defined in FORTRAN as real function wh(x,y,z)

integer x,y,z x = mod(171*x, 30269)

y = mod(172*y, 30307)

z = mod(170*z, 30323)

wh = mod(x/30269.0 + y/30307.0 + z/30323.0, 1.0)

end

(a) Implement in S a version of runif using the Wichmann-Hill generator. Consider where the seed vector should be stored, and how it should be initialized.

(b) Re-implement the function calling C or FORTRAN code.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Modern Applied Statistics With S-Plus

ISBN: 9781489928191

1st Edition

Authors: W. N. Venables, B. D. Ripley

Question Posted: