accept.reject: Function to generate categorical random numbers from the...

Description Usage Arguments Details Value Author(s) Examples

Description

Generates random numbers from the desired categorical distribution with given probabilities. Utilizes discrete uniform distribution.

Usage

1
accept.reject(prob, a, b, n)

Arguments

prob

a vector of probabilities

a

a numeric value which denotes the lower bound of the discrete uniform

b

a numeric value which denotes the upper bound of the discrete uniform

n

a numeric value for sample size

Details

b-a+1 should be equal to the number of levels of the desired variable.

Value

returns a vector of simulated sample of size n.

Author(s)

Ozgur Asar

Examples

1
accept.reject(prob=c(0.3,0.4,0.2,0.1),a=0,b=3,n=100)

OOmisc documentation built on May 1, 2019, 10:17 p.m.

Related to accept.reject in OOmisc...