Learn R Programming

texmexseq (version 0.3)

poilogMLE: maximum likelihood estimation for the Poisson lognormal

Description

Fit a set of OTU counts to the Poisson lognormal distribution.

Usage

poilogMLE(n, start.mu, start.sig, trunc=TRUE, method='L-BFGS-B', control=list(fnscale=length(n)), ...)

Arguments

n
vector of observed counts
start.mu
initial estimate for the lognormal mean
start.sig
initial estimate for the lognormal standard deviation
trunc
remove weight from zero counts?
method
optimization method for optim
control
list of parameters for optim
...
further parameters to go to optim

Value

Details

The function estimates parameters mean mu and standard deviation sig.

The parameters must be given starting values for the optimization procedure. The default values here worked well when fitting OTUs in the referenced paper.

The function uses the optimization procedures in optim to make the maximum likelihood estimate. The method and control arguments are passed to optim.

A zero-truncated distribution (see dpoilog) is assumed by default. Truncation should only be turned off if all the known OTUs of the sequenced community are known. In most cases, this is not applicable, since it is usually not possible to know if an OTU had zero counts because it is not present in the environment or if it is present but in low abundance.

See Also

dpoilog optim

Examples

Run this code
# create some random data
x <- rpoilog(S=1000, mu=-2.0, sig=2.0, keep0=FALSE)

# fit that data
res <- poilogMLE(x, 2.0, -2.0)

# the results should be fairly robust to the starting parameters
res2 <- poilogMLE(x, 1.0, 0.5)

Run the code above in your browser using DataLab