ucateg: draws from a categorical distribution

Description Usage Arguments Details Value Examples

Description

Following the description given in /prr/ document, returns draws from a so-called categorical distribution defined by the lim vector of limits. The number of limits must be greater or equal to 3. The returned values are in between the two extreme limits.
The number of returned draws is max(length(mu),length(coefvar)). When both lengths are not equal, the smaller one must be equal to one, if not an error is issued.
NA value are possible in mu and coefvar, then missing values are returned for the considered draws.

Usage

1
ucateg(mu, coefvar, lim)

Arguments

mu

numeric vector of the expectations. From it the central limit is choosen.

coefvar

numeric vector of coefficients of variation. Either a common value for every draws, or a value for each of the draws. Cannot be negative.

lim

vector of the ordered limits; at least three limits. The limits are common for all draws.

Details

Extensive use is made of the function ubeta.

Value

A vector of the drawn values, possibly containing NA.

Examples

1
2
3
 prr3k("RESET"); # For R checking compliance
 set.seed(1234); 
 ucateg(round(10*runif(25)), 30, 1:10);

prr documentation built on May 2, 2019, 6:35 p.m.

Related to ucateg in prr...