Density and random generation for the Poisson lognormal distribution with parameters `mu`

and `sig`

.

1 2 |

`n` |
vector of observed individuals for each species |

`S` |
number of species in the community |

`mu` |
mean of lognormal distribution |

`sig` |
standard deviation of lognormal distribution |

`nu` |
sampling intensity, defaults to 1 |

`condS` |
logical; if TRUE random deviates are conditonal on S |

`keep0` |
logical; if TRUE species with count 0 are included in the random deviates |

The following is written from the perspective of using the Poisson lognormal distribution to describe community structure (the distribution of species when sampling individuals from a community of several species).

Under the assumption of random sampling, the number of individuals sampled from a given
species with abundance *y*, say *N*, is Poisson distributed with mean *\code{nu}\emph{y}*
where the parameter `nu`

expresses the sampling intensity. If ln *y* is normally distributed
with mean `mu`

and standard deviaton `sig`

among species, then the vector of individuals sampled
from all `S`

species then constitutes a sample from the Poisson lognormal distribution
with parameters (`mu`

+ ln `nu`

, `sig`

), where `mu`

and `sig`

are the mean and standard deviaton of the log abundances. For `nu`

= 1, this is the Poisson
lognormal distribution with parameters (`mu`

,`sig`

) which may be written in the form

*
P(N=\code{n}; \code{mu},\code{sig}) = q(\code{n}; \code{mu},\code{sig}) = \int_-infty^infty g_\code{n}(\code{mu},\code{sig},u) phi(u) du,*

where *φ(u)* is the standard normal distribution and

*
g_n(\code{mu},\code{sig},u) = exp(\code{mu} \code{sig} \code{n} + \code{mu} \code{n} + exp(-\code{mu} \code{sig} + \code{mu})) / \code{n}!*

Since `S`

is usually unknown, we only consider the observed number of individuals for the observed species.
With a general sampling intensity `nu`

, the distribution of the number of individuals then follows the
zero-truncated Poisson lognormal distribution

*
q(\code{n}; \code{mu},\code{sig})/(1 - q(0; \code{mu},\code{sig}))*

`dpoilog`

returns the density

`rpoilog`

returns random deviates

Vidar Grøtan vidar.grotan@bio.ntnu.no and Steinar Engen

Engen, S., R. Lande, T. Walla & P. J. DeVries. 2002. Analyzing spatial structure of communities using the two-dimensional Poisson lognormal species abundance model. American Naturalist 160: 60-73.

`poilogMLE`

for ML estimation

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ```
### plot density for given parameters
barplot(dpoilog(n=0:20,mu=2,sig=1),names.arg=0:20)
### draw random deviates from a community of 50 species
rpoilog(S=50,mu=2,sig=1)
### draw random deviates including zeros
rpoilog(S=50,mu=2,sig=1,keep0=TRUE)
### draw random deviates with sampling intensity = 0.5
rpoilog(S=50,mu=2,sig=1,nu=0.5)
### how many species are likely to be observed
### (given S,mu,sig2 and nu)?
hist(replicate(1000,length(rpoilog(S=30,mu=0,sig=3,nu=0.7))))
### how many individuals are likely to be observed
### (given S,mu,sig2 and nu)?
hist(replicate(1000,sum(rpoilog(S=30,mu=0,sig=3,nu=0.7))))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.