Title: | Fractional Binomial Distributions |
---|---|
Description: | Generating fractional binomial random variables and computing density, cumulative distribution, and quantiles of fractional binomial distributions. (Lee, J. (2023) <arXiv:2209.01516>.) |
Authors: | Jeonghwa Lee [aut, cre, cph], Daniel Gernander [ctb] |
Maintainer: | Jeonghwa Lee <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2025-02-16 04:45:50 UTC |
Source: | https://github.com/leejeo25/frbinom |
Generating random variables and computing density, cumulative distribution, and quantiles of the fractional binomial distribution with the parameters size
, prob
, h
, c
.
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)
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)
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. |
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
=,
h
=,
c
= should satisfy
and
With the number of trials (size
) =, the mean of the fractional binomial random variable is
,
and the variance is asymptotically proportional to
, if
;
, if
; and
, if
.
If
c
=0, it becomes the regular binomial distribution.
A numeric vector of random variables (rfrbinom) or pmf (dfrbinom) or cdf (pfrbinom) or quantile (qfrbinom) of the fractional binomial distribution.
dfrbinom()
: The pmf of fractional binomial distribution.
pfrbinom()
: The cdf of fractional binomial distribution.
qfrbinom()
: The quantiles of fractional binomial distribution.
rfrbinom()
: The generation of fractional binomial random variables.
Lee, J. (2021). Generalized Bernoulli process with long-range dependence and fractional binomial distribution. Dependence Modeling, 9(1), 1-12.
# 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)
# 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)
Generating random variables and computing density, cumulative distribution, and quantiles of the fractional binomial distribution II with the parameters size
, h
, c
, la
.
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)
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)
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 |
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. |
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
=,
c
=,
la
= should satisfy
,
, and
.
With the number of trials (
size
) =, the mean of the fractional binomial random variable II is
,
and the k-th moment is asymptotically proportional to
for
.
A numeric vector of random variables (rfrbinom2) or pmf (dfrbinom2) or cdf (pfrbinom2) or quantile (qfrbinom2) of the fractional binomial distribution II.
dfrbinom2()
: The pmf of fractional binomial distribution II.
pfrbinom2()
: The cdf of fractional binomial distribution II.
qfrbinom2()
: The quantiles of fractional binomial distribution II.
rfrbinom2()
: The generation of fractional binomial random variables II.
Lee, J. (2023). Generalized Bernoulli process and fractional Poisson process. arXiv:2209.01516.
# 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)
# 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)