Learn R Programming

MiscMath (version 1.1)

rMWC: Multiply-With-Carry Random Number Generator

Description

Basic implementation of the multiply-with-carry generator.

Usage

rMWC(n, par)

Value

a vector of n uniform random numbers

Arguments

n

numeric: number of variates to generate.

par

an integer vector containing parameters for the generator: X, C, A, B.

References

Marsaglia, G. (2003) Random Number Generators. Journal of Modern Applied Statistical Methods. 2(1):2.

Examples

Run this code
x <- rMWC(58, c(5, 3, 6, 10))
summary(x)

Run the code above in your browser using DataLab