boot {flexmix} | R Documentation |
Bootstrap a flexmix Object
Description
Given a flexmix
object perform parametric or empirical bootstrap.
Usage
boot(object, ...)
## S4 method for signature 'flexmix'
boot(object, R, sim = c("ordinary", "empirical", "parametric"),
initialize_solution = FALSE, keep_weights = FALSE,
keep_groups = TRUE, verbose = 0, control,
k, model = FALSE, ...)
LR_test(object, ...)
## S4 method for signature 'flexmix'
LR_test(object, R, alternative = c("greater", "less"), control, ...)
Arguments
object |
A fitted finite mixture model of class |
R |
The number of bootstrap replicates. |
sim |
A character string indicating the type of simulation
required. Possible values are |
initialize_solution |
A logical. If |
keep_weights |
A logical. If |
keep_groups |
A logical. If |
verbose |
If a positive integer, then progress information
is reported every |
control |
Object of class |
k |
Vector of integers specifying for which number of components
finite mixtures are fitted to the bootstrap samples. If missing the
number of components of the fitted |
alternative |
A character string specifying the alternative
hypothesis, must be either |
model |
A logical. If |
... |
Further arguments to be passed to or from methods. |
Value
boot
returns an object of class FLXboot
which
contains the fitted parameters, the fitted priors, the log
likelihoods, the number of components of the fitted mixtures and the
information if the EM algorithm has converged.
LR_test
returns an object of class htest
containing the
number of valid bootstrap replicates, the p-value, the - twice log
likelihood ratio test statistics for the original data and the
bootstrap replicates.
Author(s)
Bettina Gruen
Examples
data("NPreg", package = "flexmix")
fitted <- initFlexmix(yn ~ x + I(x^2) | id2, data = NPreg, k = 2)
## Not run:
lrtest <- LR_test(fitted, alternative = "greater", R = 20,
verbose = 1)
## End(Not run)