anova.CAMAN.object | R Documentation |
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 \xi
obtained from the original sample.
## S3 method for class 'CAMAN.object'
anova(object, object1, nboot=2500, limit=0.01, acc=10^(-7),
numiter=5000, giveBootstrapData=FALSE, giveLikelihood=FALSE, ...)
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. |
The parameters limit, acc
and numiter
are used for the VEM algorithm in each bootstrap sample.
The function returns a list with components
overview
: comparison of the models, including BIC, LL and LL-ratio
`LL ratios in bootstrap-data`
: 90, 95, 97.5 and 99 percentiles of LL-ratios
`simulated p-value`
: p-value, quantifying the null model
Peter Schlattmann and Johannes Hoehne
McLachlan, G. and Peel, D. (2000). Finite Mixture Models, Chichester: Wiley.
Schlattmann, P. (2009). Medical Applications of Finite Mixture Models. Berlin: Springer.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.