Description Usage Arguments Details Value Author(s) References See Also Examples
Probability mass function, distribution function,
quantile function and random generation for the BerG distribution
with parameters mu
and phi
.
1 2 3 4 5 6 7 |
x |
vector of non-negative integer quantiles. |
mu |
numeric; non-negative mean. |
phi |
numeric; the dispersion index (greather than |
q |
vector of quantiles. |
lower.tail |
logical; if TRUE (default), probabilities are |
p |
vector of probabilities. |
n |
number of random values to return. |
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).
dberg
returns the probability function, pberg
gives the distribution function, qberg
gives the quantile function,
and rberg
generates random observations.
Rodrigo M. R. Medeiros <rodrigo.matheus@live.com>
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
For the populational skewness and kurtosis of the BerG distribution, use the functions skberg
and ktberg
, respectively.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.