test_unswitch: A test for 'unswitch'

View source: R/mixARsim.R

test_unswitchR Documentation

A test for 'unswitch'

Description

A test for 'unswitch'.

Usage

test_unswitch(models, true_model, allperm, ...)

Arguments

models

a list of MixAR models to process.

true_model

the MixAR model used in the experiment.

allperm

which permutations to try.

...

additional arguments to pass on to unswitch.

Details

This function permutes ('switches') randomly each model in models and calls unswitch to 'unswitch' the switched models. It calculates summary statistics for the three sets of models.

The summary statistics for the 'switched' models will often be meaningless. Those for the 'unswitched' ones should be good.

The quality of the statistics for argument models itself depend on how they are obtained and on the specifics of the model. They are good if, as is often done is mixture experiments, estimation is initialised with the true values of the parameters, since there is little scope for switching in that case. If initial values are chosen randomly, then there may still be little switching, largely dependent on the probabilities of the components.

Value

A list with the summaries for the 3 sets of models.

Author(s)

Georgi N. Boshnakov

Examples

## N is small for to make the examples run instantly.
set.seed(1234)
aII10data <- mixARExperiment(exampleModels$WL_II, N = 5, raw = TRUE,
                 estargs = list(crit = 1e-4))
aII10 <- test_unswitch(aII10data$Raw, exampleModels$WL_II)
aII10

aII10adata <- mixARExperiment(exampleModels$WL_II, N = 5, raw = TRUE,
                  simargs = list(n = 100), estargs = list(crit = 1e-4))
aII10a <- test_unswitch(aII10adata$Raw, exampleModels$WL_II)
aII10a

GeoBosh/mixAR documentation built on May 9, 2022, 7:36 a.m.