Description Usage Arguments Details Examples
Density, distribution function and random generation for the mixture of Poisson distributions.
1 2 3 4 5 |
x, q |
vector of quantiles. |
lambda |
matrix (or vector) of (non-negative) means. |
alpha |
matrix (or vector) of mixing proportions; mixing proportions need to sum up to 1. |
log, log.p |
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X ≤ x] otherwise, P[X > x]. |
n |
number of observations. If |
p |
vector of probabilities. |
Probability density function
f(x) = α[1] * f1(x; λ[1]) + … + α[k] * fk(x; λ[k])
Cumulative distribution function
F(x) = α[1] * F1(x; λ[1]) + … + α[k] * Fk(x; λ[k])
where sum(α[i]) == 1.
1 2 3 4 5 6 7 8 9 | x <- rmixpois(1e5, c(5, 12, 19), c(1/3, 1/3, 1/3))
xx <- seq(-1, 50)
plot(prop.table(table(x)))
lines(xx, dmixpois(xx, c(5, 12, 19), c(1/3, 1/3, 1/3)), col = "red")
hist(pmixpois(x, c(5, 12, 19), c(1/3, 1/3, 1/3)))
xx <- seq(0, 50, by = 0.01)
plot(ecdf(x))
lines(xx, pmixpois(xx, c(5, 12, 19), c(1/3, 1/3, 1/3)), col = "red", lwd = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.