These functions provide density, distribution function, quantile function, and random number generation for the Poisson-Lognormal (PLogN) Distribution
dpLnorm(x, mean = 1, sigma = 1, ndraws = 1500, log = FALSE, hdraws = NULL)ppLnorm(
q,
mean = 1,
sigma = 1,
ndraws = 1500,
lower.tail = TRUE,
log.p = FALSE
)
qpLnorm(p, mean = 1, sigma = 1, ndraws = 1500)
rpLnorm(n, mean = 1, sigma = 1, ndraws = 1500)
dpLnorm gives the density, ppLnorm gives the distribution function, qpLnorm gives the quantile function, and rpLnorm generates random deviates.
The length of the result is determined by n for rpLnorm, and is the maximum of the lengths of the numerical arguments for the other functions.
numeric value or a vector of values.
numeric value or vector of mean values for the distribution (the values have to be greater than 0).
single value or vector of values for the sigma parameter of the lognormal distribution (the values have to be greater than 0).
the number of Halton draws to use for the integration.
logical; if TRUE, probabilities p are given as log(p).
and optional vector of Halton draws to use for the integration.
quantile or a vector of quantiles.
logical; if TRUE, probabilities p are \(P[X\leq x]\) otherwise, \(P[X>x]\).
logical; if TRUE, probabilities p are given as log(p).
probability or a vector of probabilities.
the number of random numbers to generate.
dpLnorm computes the density (PDF) of the Poisson-Lognormal
Distribution.
ppLnorm computes the CDF of the Poisson-Lognormal Distribution.
qpLnorm computes the quantile function of the Poisson-Lognormal
Distribution.
rpLnorm generates random numbers from the Poisson-Lognormal
Distribution.
The compound Probability Mass Function (PMF) for the Poisson-Lognormal distribution is: $$f(y|\mu,\theta,\alpha)= \int_0^\infty \frac{\mu^y x^y e^{-\mu x}}{y!} \frac{exp\left(-\frac{ln^2(x)}{2\sigma^2} \right)}{x\sigma\sqrt{2\pi}}dx$$
Where \(\sigma\) is a parameter for the lognormal distribution with the restriction \(\sigma>0\), and \(y\) is a non-negative integer.
The expected value of the distribution is: $$E[y]=e^{X\beta+\sigma^2/2} = \mu e^{\sigma^2/2}$$ Halton draws are used to perform simulation over the lognormal distribution to solve the integral.
dpLnorm(0, mean=0.75, sigma=2, ndraws=10)
ppLnorm(c(0,1,2,3,5,7,9,10), mean=0.75, sigma=2, ndraws=10)
qpLnorm(c(0.1,0.3,0.5,0.9,0.95), mean=0.75, sigma=2, ndraws=10)
rpLnorm(30, mean=0.75, sigma=2, ndraws=10)
Run the code above in your browser using DataLab