Score function, hessian, mean, and variance for the Poisson distribution with parameter lambda.
Usage
spois(x, lambda, parameter = "lambda", drop = TRUE)
hpois(x, lambda, parameter = "lambda", drop = TRUE)
mean_pois(lambda, drop = TRUE)
var_pois(lambda, drop = TRUE)
Arguments
x
vector of quantiles.
lambda
vector of (non-negative) means.
parameter
character. Derivatives are computed wrt this paramter. Note: Only “lambda” is implemented.
drop
logical. Should the result be a matrix (drop = FALSE) or should the dimension be dropped (drop = TRUE, the default)?
Details
The Poisson distribution has density
\(p(x) = \frac{\lambda^x e^{-\lambda}}{x!}\)
for \(x = 0, 1, 2, \ldots\) .
The score function is
\(s(\lambda) = \frac{x}{\lambda} - 1\)
The hessian is
\(h(\lambda) = - \frac{x}{\lambda^2}\)
Value
spois gives the score function, i.e., the 1st derivative of the log-density wrt lambda and hpois gives the hessian, i.e., the 2nd derivative of the log-density wrt lambda. mean and var give the mean and variance, respectively.
See Also
Poisson encompassing dpois, ppois, qpois and rpois.