rBetacBinom: Random Number Generation under Lord's Beta Compound-Binomial...

View source: R/betafunctions.R

rBetacBinomR Documentation

Random Number Generation under Lord's Beta Compound-Binomial Distribution.

Description

Random number generation under Lord's Beta Compound-Binomial distribution, where the Compound-Binomial distribution is Lord's two-term approximation.

Usage

rBetacBinom(x, N, k, l, u, alpha, beta)

Arguments

x

Number of draws.

N

Number of trials.

k

Lord's k (see documentation for the Lords.k() function).

l

The lower-bound location parameter of the four-parameter Beta distribution.

u

The upper-bound location parameter of the four-parameter Beta distribution.

alpha

The first shape-parameter of the four-parameter Beta distribution.

beta

The second shape-parameter of the four-parameter Beta distribution.

Note

For larger values of k, the distribution can yield negative probabilities which returns an error.

Examples

# To draw a sample of 50 values from a Beta Compound-Binomial distribution
# with number of trials = 100, Lord's k = 1, and probabilities of successful
# trials drawn from a four-parameter Beta distribution with location-
# parameters l = .15 and u = .85, and shape parameters alpha = 6 and
# beta = 4:
rBetacBinom(x = 50, N = 100, k = 1, l = .15, u = .85, alpha = 6, beta = 4)

betafunctions documentation built on May 29, 2024, 1:13 a.m.