Learn R Programming

texmexseq (version 0.3)

texmex.fit: 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

Value

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.

See Also

poilogMLE

Examples

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

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

Run the code above in your browser using DataLab