| Poisson lognormal {poilog} | R Documentation |
Density and random generation for the Poisson lognormal distribution with parameters mu and sig.
dpoilog(n, mu, sig) rpoilog(S, mu, sig, nu=1, condS=FALSE, keep0=FALSE)
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 nuy
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=n; mu,sig) = q(n; mu,sig) = int_-infty^infty g_n(mu,sig,u) phi(u) du,
where phi(u) is the standard normal distribution and
g_n(mu,sig,u) = exp(mu sig n + mu n + exp(-mu sig + mu)) / 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(n; mu,sig)/(1 - q(0; mu,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
### 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))))