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
Get step-by-step solutions from verified subject matter experts
