wh: Wichmann-Hill (WH) Random Number Generator

View source: R/gens.R

whR Documentation

Wichmann-Hill (WH) Random Number Generator

Description

The Wichmann-Hill (WH) algorithm is an extension of linear congruential. WH uses three linear congruential equations, adds the results, then takes the decimal part of the sum. For example, if the three WH equations give 0.68, 0.92, and 0.35, then the final result random number is decimal(0.78 + 0.92 + 0.45) = decimal(2.95) = 0.95.

Usage

wh(n, seed, a, c, m)

Arguments

n

number of random numbers

seed

3 seeds

a

3 positive integers

c

3 positive integers

m

3 positive integers


mnaR99/mshelpers documentation built on May 22, 2022, 6:03 a.m.