Learn R Programming

aster (version 1.1-3)

truncated: K-Truncated Distributions

Description

Random generation for the \(k\)-truncated Poisson distribution or for the \(k\)-truncated negative binomial distribution, where “\(k\)-truncated” means conditioned on being strictly greater than \(k\). If xpred is not one, then the random variate is the sum of xpred such random variates.

Usage

rktp(n, k, mu, xpred = 1)
rktnb(n, size, k, mu, xpred = 1)
rnzp(n, mu, xpred = 1)

Value

a vector of random deviates.

Arguments

n

number of random values to return. If length(n) > 1, the length is taken to be the number required.

size

the size parameter for the negative binomial distribution.

k

truncation limit.

xpred

number of trials.

mu

vector of positive means.

Details

rktp simulates \(k\)-truncated Poisson random variates. rktnb simulates \(k\)-truncated negative binomial random variates. rnzp simulates zero-truncated Poisson random variates (maintained only for backward compatibility, it now calls rktp).

See Also

families

Examples

Run this code
rktp(10, 2, 0.75)
rktnb(10, 2.222, 2, 0.75)

Run the code above in your browser using DataLab