Last chance! 50% off unlimited learning
Sale ends in
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)
vector of (non-negative integer) quantiles.
vector of quantiles.
vector of probabilities.
number of random values to return.
Mean of the linear predictor. A single numeric value.
Standard deviation of the linear predictor. A single numeric value.
Inverse link function. A function in the R language,
used to transform the linear predictor into the
parameter lambda
of the Poisson distribution.
Logical. If TRUE
(the default), probabilities are
Number of quadrature points in the Gauss-Hermite quadrature approximation. A small positive integer.
Numeric vector:
dmixpois
gives probability masses,
ppois
gives cumulative probabilities,
qpois
gives (non-negative integer) quantiles, and
rpois
generates (non-negative integer) random deviates.
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 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.
# NOT RUN {
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)
# }
Run the code above in your browser using DataLab