Learn R Programming

MiscMath (version 1.1)

rlincong: Linear Congruential Generator

Description

Basic implementation of the linear congruential random number generator.

Usage

rlincong(n, seed, par)

Value

a vector of n uniform random numbers

Arguments

n

numeric: number of variates to generate.

seed

numeric: initial seed.

par

an integer vector containing parameters for the generator: a, cc, m.

Examples

Run this code
x <- rlincong(1000, 6976, c(171, 0, 30269))
summary(x)

Run the code above in your browser using DataLab