Last data update: 2014.03.03

R: wrapper for fitting the Poisson lognormal
texmex.fitR Documentation

wrapper for fitting the Poisson lognormal

Description

A nice wrapper for the poilogMLE function.

Usage

  texmex.fit(n, start.mus=c(-2.0, -1.0, 0.0, 1.0, 2.0), start.sigs=rep(1.0, times=5), ...)

Arguments

n

vector of observed counts

start.mus

vector of starting mu values

start.sigs

vector of starting sig values

...

further parameters to go to poilogMLE

Details

It can be a little annoying to direclty use poilogMLE: the optimization can fail to converge if you choose a bad starting mu value. This function makes multiple attempts at fitting the poilog distribution, returning the first one that works.

For the first attempt, the first mu and sig are used as starting values. For the second attempt, the second elements of those vectors, etc.

Value

par

Maximum likelihood estimates of the parameters

p

Approximate fraction of OTUs revealed by the sample

logLval

Log likelihood of the data given the estimated parameters

Author(s)

Scott Olesen swo@mit.edu

See Also

poilogMLE

Examples

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

# fit that data
res <- texmex.fit(x)

Results