inflmix: Estimate the one-inflated positive Poisson mixture model...

Description Usage Arguments Value See Also Examples

View source: R/inflmix.R

Description

Estimate the one-inflated positive Poisson mixture model (OIPPMM)

Usage

1
2
3
inflmix(y, l = NULL, p = NULL, K = NULL, tol = 1e-05,
  maxLikmethod = "nr", maxiters = 10000, minlam = 0.01, reduntol = 0.05,
  maxk = 4)

Arguments

y

A vector of positive integers.

l

lambda, a vector of starting values for the positive Poisson components. If NULL, starting values will be found via grid search, and mixture models with successively more components will be estimated until the non-parametric MLE is found, or maxk is reached.

p

pi, a vector of starting values for the mixture weights. l and p must be initialized together, or not at all. If NULL, grid search and estimation for successive numbers of mixture components will commence until the non-parametric MLE is found, or maxk is reached.

K

the number of components to be estimated in the OIPPMM. If NULL, mixture models with successively more components will be estimated until the non-parametric MLE is found, or maxk is reached.

tol

Tolerance of the EM algorithm. The EM algorithm proceeds until the proportional difference between all successive parameter estimates for lambda and pi are less than tol. Default is 0.001%.

maxLikmethod

Maximization method passed to maxLik. Default is Newton-Raphson.

maxiters

Maximum number of EM iterations.

minlam

The minimum value that a mixture component can have before it is considered to be a redundant one-inflating component. If any value in lambda is less than minlam, the algorithm stops and the non-parametric MLE is declared to be found. Only relevant if l and p are NULL, so that inflmix is searching for the non-parametric MLE.

reduntol

After the EM algorithm converges, the estimation process will begin again (including a grid search for new starting values), unless any two components in lambda are within reduntol of each other. The non-parametric MLE is then declared to be found. Only relevant if l and p are NULL.

maxk

The maximum number of positive Poisson components to be attempted in the search for the non-parametric MLE.

Value

If inflmix is called with starting values for l and p, returns a list containing:

termreas the reason that the EM algorithm terminated (either convergence or iteration limit)
iterations the number of iterations until convergence
lambda the estimated values for the positive Poisson parameters
pi the estimated values for the component weights
logl the value of the log-likelihood function evaluated at the parameter estimates for lambda and pi
n the sample size, the length of the vector y
predicted the predicted counts obtained by evaluting the probability mass function of the OIPPMM model at the parameter estimates for lambda and pi, and for y = 1,…,max(y)
chisq the Pearson chi-square distance statistic obtained by comparing the actual and predicted counts
HTn0 the Horvitz-Thompson estimator for the number of missing zeros

If inflmix is called without starting values for l and p (l=NULL and p=NULL), then inflmix returns an object of class 'inflmixNPMLE', a list containing each of the above objects, for each estimated OIPPMM model with successively more mixture components, in the search for the non-parametric MLE. An additional object is also provided: termreasNPMLE which documents the reason for the termination of the search for the NPMLE (either NPMLE found, or maxk reached).

See Also

rinflmix and rinflmixN for the generation of random numbers from the OIPPMM.

Examples

1
2
3
4
5
6
7
8
9
# Estimate several OIPPMMs with increasing number of components, until adding an
# additional component yields no improvement in the log-likelihood.
zz <- inflmix(1:20)
# The custom print method displays results in table
zz
# Provide starting values instead of searching for the NPMLE
inflmix(1:20, l=c(1, 4), p=c(.4, .4))
# Fix the number of components, without providing starting values
inflmix(1:20, K = 2)

rtgodwin/inflmix documentation built on May 27, 2019, 2:10 p.m.