hpois-extensions | R Documentation |
Score function, hessian, mean, and, variance
for the (zero-)hurdle Poisson
distribution with parameters mu
(= mean of the
underlying Poisson distribution) and hurdle crossing probability
pi
(i.e., 1 - pi
is the probability for observed zeros).
shpois(x, lambda, pi, parameter = c("lambda", "pi"), drop = TRUE)
hhpois(x, lambda, pi, parameter = c("lambda", "pi"), drop = TRUE)
mean_hpois(lambda, pi, drop = TRUE)
var_hpois(lambda, pi, drop = TRUE)
x |
vector of (positive integer) quantiles. |
lambda |
vector of non-negative means of the underlying Poisson distribution. |
pi |
vector of hurdle crossing probabilities (i.e., |
parameter |
character. Should the derivative with respect to
|
drop |
logical. Should the result be a matrix ( |
The underlying Poisson distribution has density
f(x) = \frac{\lambda^x e^{-\lambda}}{x!}
for x = 0, 1, 2, \ldots
. The hurdle density is then simply obtained as
g(x) = \pi \cdot \frac{f(x)}{1 - f(0)}
for x = 1, 2, \ldots
and g(0) = 1 - \pi
, respectively.
shpois
gives the score function (= derivative of
the log-density with respect to lambda and/or pi).
hhpois
gives the hessian (= 2nd derivative of
the log-density with respect to lambda and/or pi).
mean_hpois
and var_hpois
give the mean and
the variance, respectively.
dhpois
, dpois
, hurdle
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.