dmixpois | R Documentation |
Density, distribution function, quantile function and random generation for a mixture of Poisson distributions.
dmixpois(x, mu, sd, invlink = exp, GHorder = 5)
pmixpois(q, mu, sd, invlink = exp, lower.tail = TRUE, GHorder = 5)
qmixpois(p, mu, sd, invlink = exp, lower.tail = TRUE, GHorder = 5)
rmixpois(n, mu, sd, invlink = exp)
x |
vector of (non-negative integer) quantiles. |
q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of random values to return. |
mu |
Mean of the linear predictor. A single numeric value. |
sd |
Standard deviation of the linear predictor. A single numeric value. |
invlink |
Inverse link function. A function in the R language,
used to transform the linear predictor into the
parameter |
lower.tail |
Logical. If |
GHorder |
Number of quadrature points in the Gauss-Hermite quadrature approximation. A small positive integer. |
These functions are analogous to
dpois
ppois
,
qpois
and
rpois
except that they apply to a mixture of Poisson distributions.
In effect, the Poisson mean parameter lambda
is randomised
by setting lambda = invlink(Z)
where Z
has a Gaussian N(\mu,\sigma^2)
distribution.
The default is invlink=exp
which means that
lambda
is lognormal. Set invlink=I
to assume
that lambda
is approximately Normal.
For dmixpois
, pmixpois
and qmixpois
,
the probability distribution is approximated using Gauss-Hermite
quadrature. For rmixpois
, the deviates are simulated
exactly.
Numeric vector:
dmixpois
gives probability masses,
ppois
gives cumulative probabilities,
qpois
gives (non-negative integer) quantiles, and
rpois
generates (non-negative integer) random deviates.
, \rolf
and \ege
dpois
,
gauss.hermite
.
dmixpois(7, 10, 1, invlink = I)
dpois(7, 10)
pmixpois(7, log(10), 0.2)
ppois(7, 10)
qmixpois(0.95, log(10), 0.2)
qpois(0.95, 10)
x <- rmixpois(100, log(10), log(1.2))
mean(x)
var(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.