berg: The BerG Distribution

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Probability mass function, distribution function, quantile function and random generation for the BerG distribution with parameters mu and phi.

Usage

1
2
3
4
5
6
7
dberg(x, mu, phi)

pberg(q, mu, phi, lower.tail = TRUE)

qberg(p, mu, phi, lower.tail = TRUE)

rberg(n, mu, phi)

Arguments

x

vector of non-negative integer quantiles.

mu

numeric; non-negative mean.

phi

numeric; the dispersion index (greather than abs(mu - 1)),

q

vector of quantiles.

lower.tail

logical; if TRUE (default), probabilities are P(X <= x), otherwise, P(X > x).

p

vector of probabilities.

n

number of random values to return.

Details

This set of functions represents the probability function, the cumulative distribution function, quantile function and a random number generator for the BerG distribution parameterized in terms of the mean and the dispersion index. This new parameterization was proposed by Bourguignon, M. & Medeiros, R. (2020).

Value

dberg returns the probability function, pberg gives the distribution function, qberg gives the quantile function, and rberg generates random observations.

Author(s)

Rodrigo M. R. Medeiros <rodrigo.matheus@live.com>

References

Bourguignon, M. & Weiss, C. (2017). An INAR(1) process for modeling count time series with equidispersion, underdispersion and overdispersion. Test, 26, 847–868.

Bourguignon, M. & Medeiros, R. (2020). A simple and useful regression model for fitting count data

See Also

For the populational skewness and kurtosis of the BerG distribution, use the functions skberg and ktberg, respectively.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# BerG observations as categorical data:
Ni <- rberg(50, mu = 4, phi = 3.2); table(factor(Ni, 0:max(Ni)))
plot(prop.table(table(Ni)))
points(sort(unique(Ni)), dberg(sort(unique(Ni)), mu = 4, phi = 3.2), pch=16, col="red")

# Probability function:

# Parameters
mu = c(2.3, 3, 3.9); phi = 3

plot(0:17-0.25,dberg(0:17,phi,mu[1]),type="h",xlab=" ",ylab="Pmf",
col="gray70",lwd=5);mtext("y",side=1,line=2.5)
segments(0:17,rep(0,length(0:17)),0:17,dberg(0:17,phi,mu[2]),col="gray40",lwd=5)
segments(0:17+0.25,rep(0,length(0:17)),0:17+0.25,dberg(0:17,phi,mu[3]),col="gray20",lwd=5)

legend(13,0.32,legend =c(expression(mu==2.3),
          expression(mu==3), expression(mu==3.9)),
          lty=1,lwd=5,col=c("gray70","gray40","gray20"),bty="n")

rdmatheus/bergrm documentation built on Oct. 1, 2020, 4:38 a.m.