anova.CAMAN.object: ANOVA for finite mixture models

Description Usage Arguments Details Value Author(s) References Examples

View source: R/CAMAN.R

Description

A common problem in the estimation of mixture models is to determine the number of components. This may be done using a parametric bootstrap. This function simulates from a mixture model under the null hypothesis with k0 components. A mixture model with k0 and usually k0 +1 components is fit to the data and then the likelihood ratio statistic (LRS) is computed.

Based on the bootstrap the distribution of the LRS is obtained which allows to obtain an approximation to the achieved level of significance corresponding to the value of -2 \log ξ obtained from the original sample.

Usage

1
2
3
## S3 method for class 'CAMAN.object'
anova(object, object1, nboot=2500, limit=0.01, acc=10^(-7), 
     numiter=5000, giveBootstrapData=FALSE, giveLikelihood=FALSE, ...)

Arguments

object

A CAMAN-object which quantifies a finite mixture model under null hypothesis.

object1

A CAMAN-object which quantifies another finite mixture model under the alterative hypothesis.

nboot

Number of bootstrap samples.

limit

parameter to control the limit of union several components. Default is 0.01.

acc

convergence criterion. VEM and EM loops stop when deltaLL<acc. Default is 10^(-7).

numiter

parameter to control the maximal number of iterations in the VEM and EM loops. Default is 5000.

giveBootstrapData

A Boolean that indicates whether the bootstrapped data should be returned or not

giveLikelihood

Return the likelihood-values of both models for each generated dataset.

...

Arguments to be passed on to other methods; currently none.

Details

The parameters limit, acc and numiter are used for the VEM algorithm in each bootstrap sample.

Value

The function returns a list with components

Author(s)

Peter Schlattmann and Johannes Hoehne

References

McLachlan, G. and Peel, D. (2000). Finite Mixture Models, Chichester: Wiley.

Schlattmann, P. (2009). Medical Applications of Finite Mixture Models. Berlin: Springer.

Examples

1
2
3
4
5
6
data(thai_cohort)
mix0 <- mixalg(obs="counts", weights="frequency", family="poisson", data=thai_cohort,
               numiter=18000, acc=0.00001,startk=25)
em0<-mixalg.EM(mix0,p=c(1),t=c(1))
em1<-mixalg.EM(mix0,p=c(0.7,0.3),t=c(2,9))
## Not run: ll<-anova(em0,em1,nboot=250) #might take some minutes

Example output

Loading required package: sp
Loading required package: mvtnorm

CAMAN documentation built on May 1, 2019, 9:21 p.m.