Polono {VGAM} | R Documentation |
Density, and random generation for the Poisson lognormal distribution.
dpolono(x, meanlog=0, sdlog=1, ...) rpolono(n, meanlog=0, sdlog=1)
x |
vector of quantiles. |
n |
number of observations. Must be a positive integer of length 1. |
meanlog, sdlog |
the mean and standard deviation of the normal distribution (on the
log scale).
They match the arguments in
Lognormal .
|
... |
Arguments passed into
integrate .
|
The Poisson lognormal distribution is similar to the negative binomial in that it can be motivated by a Poisson distribution whose mean parameter comes from a right skewed distribution (gamma for the negative binomial and lognormal for the Poisson lognormal distribution).
dpolono
gives the density, and
rpolono
generates random deviates.
dpolono
involves numerical integration that is performed using
integrate
. Consequently, computations may be very
slow. Also, numerical problems may occur, and if so, then the use of
...
may be needed.
For the maximum likelihood estimation of the 2 parameters a VGAM
family function called polono
, say, has not been written yet.
T. W. Yee
lognormal
,
poissonff
,
negbinomial
.
## Not run: meanlog = 0.5; sdlog = 0.5 y = 0:19 proby = dpolono(y, m=meanlog, sd=sdlog) plot(y, proby, type="h", col="blue", las=1, ylab="P[Y=y]", log="", main=paste("Poisson lognormal(meanlog=",meanlog,", sdlog=",sdlog,")", sep="")) sum(proby) # Should be 1 y = rpolono(n=1000, m=meanlog, sd=sdlog) table(y) hist(y, breaks=((-1):max(y))+0.5, prob=TRUE) ## End(Not run)