Title: Fractional Binomial Distributions
Version: 1.0.0
Description: Generating fractional binomial random variables and computing density, cumulative distribution, and quantiles of fractional binomial distributions. (Lee, J. (2023) <doi:10.48550/arXiv.2209.01516>.)
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.2.3
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2023-06-06 20:48:45 UTC; leeje
Author: Jeonghwa Lee [aut, cre, cph], Daniel Gernander [ctb]
Maintainer: Jeonghwa Lee <leejeonghwa5@gmail.com>
Repository: CRAN
Date/Publication: 2023-06-07 13:40:02 UTC

Fractional binomial distributions

Description

Generating random variables and computing density, cumulative distribution, and quantiles of the fractional binomial distribution with the parameters size, prob, h, c.

Usage

dfrbinom(x, size, prob, h, c, start = FALSE)

pfrbinom(x, size, prob, h, c, start = FALSE)

qfrbinom(p, size, prob, h, c, start = FALSE)

rfrbinom(n, size, prob, h, c, start = FALSE)

Arguments

x

A numeric vector specifying values of the fractional binomial random variable at which the pmf or cdf is computed.

size

A number specifying the total number of trials.

prob

A number specifying the probability of success in each trial.

h

A number specifying the strength of the dependency among trials; it determines the skewness of the distribution.

c

A number specifying the overdispersion of distributions.

start

logical; if TRUE, the starting point is changed after the first success in the generalized Bernoulli process. The default is FALSE.

p

A numeric vector specifying probabilities at which quantiles of the fractional binomial distribution are computed.

n

A number of random variables to be simulated.

Details

The regular binomial random variable counts the number of successes in i.i.d. Bernoulli trials. In the fractional binomial distribution, the number of successes is counted among dependent Bernoulli trials that are from the generalized Bernoulli process (GBP). In GBP, each trial has the constant probability of success prob, and the strength of the dependency among the trials is determined by the parameters, h and c. The parameters c and h are related to the overdispersion and skewness of the fractional binomial distribution. The parameters prob=p, h=H, c=c should satisfy p,H \in (0,1) and

0\leq c<\min\{1-p, \frac{1}{2} ( -2p+2^{2H-2} +\sqrt{4p-p2^{2H}+2^{4H-4}})\}.

With the number of trials (size) =n, the mean of the fractional binomial random variable is E(X)=np, and the variance is asymptotically proportional to n^{2H}, if H\in (0.5, 1); n\ln n, if H=0.5; and n, if H\in (0, .5). If c=0, it becomes the regular binomial distribution.

Value

A numeric vector of random variables (rfrbinom) or pmf (dfrbinom) or cdf (pfrbinom) or quantile (qfrbinom) of the fractional binomial distribution.

Functions

References

Lee, J. (2021). Generalized Bernoulli process with long-range dependence and fractional binomial distribution. Dependence Modeling, 9(1), 1-12.

Examples

# 10 random variables of a fractional binomial distribution.
rfrbinom(n=10, size=50, prob=.6, h=.8, c=.2)
# The probability that the fractional binomial random variable equals 22.
dfrbinom(x=22, size=50, prob=.6, h=.8, c=.2)
# The probability that the fractional binomial random variable is less than or equal to 22.
pfrbinom(x=22, size=50, prob=.6, h=.8, c=.2)
 # The 80th percentile of the fractional binomial distribution.
qfrbinom(p=.8, size=50, prob=.6, h=.8, c=.2)


Fractional binomial distribution II

Description

Generating random variables and computing density, cumulative distribution, and quantiles of the fractional binomial distribution II with the parameters size, h, c, la.

Usage

dfrbinom2(x, size, h, c, la = c/2, start = FALSE)

pfrbinom2(x, size, h, c, la = c/2, start = FALSE)

qfrbinom2(p, size, h, c, la = c/2, start = FALSE)

rfrbinom2(n, size, h, c, la = c/2, start = FALSE)

Arguments

x

A numeric vector specifying values of the fractional binomial random variable II at which the pmf or cdf is computed.

size

A number specifying the total number of trials.

h

A number specifying the strength of the dependency among trials.

c

A number specifying the dispersion of distributions.

la

A number related to the probability of success in a trial; the default value is c/2.

start

logical; if TRUE, the starting point is changed after the first success in the generalized Bernoulli process II. The default is FALSE.

p

A numeric vector specifying probabilities at which quantiles of the fractional binomial distribution II are computed.

n

A number of random variables to be simulated.

Details

In the fractional binomial distribution II, the number of successes is counted in the generalized Bernoulli process II (GBP II). In GBP II, each trial has the constant probability of success la*size^{2h-2}, and the strength of the dependency among the trials is determined by the parameters, h and c. The parameters h=H, c=c, la=\lambda should satisfy H \in (0.5,1), 0< c< 2^{2H-2}, and 0<\lambda<c. With the number of trials (size) =n, the mean of the fractional binomial random variable II is E(X)=n\lambda^{2H-1}, and the k-th moment is asymptotically proportional to n^{(2H-1)k} for k\geq 2.

Value

A numeric vector of random variables (rfrbinom2) or pmf (dfrbinom2) or cdf (pfrbinom2) or quantile (qfrbinom2) of the fractional binomial distribution II.

Functions

References

Lee, J. (2023). Generalized Bernoulli process and fractional Poisson process. arXiv:2209.01516.

Examples

# 10 random variables of a fractional binomial distribution II.
rfrbinom2(n=10, size=50, h=.8, c=.2)
# The probability that the fractional binomial random variable II equals 22.
dfrbinom2(x=22, size=50, h=.8, c=.2)
# The probability that the fractional binomial random variable II is less than or equal to 22.
pfrbinom2(x=22, size=50, h=.8, c=.2)
 # The 80th percentile of the fractional binomial distribution.
qfrbinom2(p=.8, size=50, h=.8, c=.2)

mirror server hosted at Truenetwork, Russian Federation.