| PoissonLognormal | R Documentation |
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)
x |
numeric value or a vector of values. |
mean |
numeric value or vector of mean values for the distribution (the values have to be greater than 0). |
sigma |
single value or vector of values for the sigma parameter of the lognormal distribution (the values have to be greater than 0). |
ndraws |
the number of Halton draws to use for the integration. |
log |
logical; if TRUE, probabilities p are given as log(p). |
hdraws |
and optional vector of Halton draws to use for the integration. |
q |
quantile or a vector of quantiles. |
lower.tail |
logical; if TRUE, probabilities p are |
log.p |
logical; if TRUE, probabilities p are given as log(p). |
p |
probability or a vector of probabilities. |
n |
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 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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.