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,

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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Statistics Principles And Methods Questions!