Learn R Programming

rebmix (version 2.6.1)

boot: Parametric or Nonparametric Bootstrap for Standard Error and Coefficient of Variation Estimation

Description

Returns the boot.REBMIX output for mixtures of conditionally independent normal, lognormal, Weibull, gamma, binomial, Poisson or Dirac component densities.

Usage

## S3 method for class 'REBMIX':
boot(x, pos = 1, Bootstrap = "parametric", 
     B = 100, n = NULL, replace = TRUE, prob = NULL, ...)

Arguments

x
an object of class REBMIX.
pos
a desired row number in x$summary to be bootstrapped. The default value is 1.
Bootstrap
a character vector giving the bootstrap type. One of default "parametric" or "nonparametric".
B
number of bootstrap datasets. The default value is 100.
n
number of observations. The default value is NULL.
replace
logical. The sampling is with replacement if TRUE, see also sample. The default value is TRUE.
prob
a vector of length $n$ containing probability weights, see also sample. The default value is NULL.
...
further arguments to sample.

Value

  • ca data frame containing numbers of components for $B$ bootstrap datasets.
  • c.sestandard error of numbers of components c.
  • c.cvcoefficient of variation of numbers of components c.
  • c.modemode of numbers of components c.
  • c.probprobability of mode c.mode.
  • wa data frame containing component weights for $\leq B$ bootstrap datasets.
  • w.sea vector containing standard errors of component weights w.
  • w.cva vector containing coefficients of variation of component weights w.
  • theta1.idata frames containing component parameters theta1.i for $\leq B$ bootstrap datasets.
  • theta1.i.sevectors containing standard errors of component parameters theta1.i.
  • theta1.i.cvvectors containing coefficients of variation of component parameters theta1.i.
  • theta2.idata frames containing component parameters theta2.i for $\leq B$ bootstrap datasets.
  • theta2.i.sevectors containing standard errors of component parameters theta2.i.
  • theta2.i.cvvectors containing coefficients of variation of component parameters theta2.i.

References

G. McLachlan and D. Peel. Finite Mixture Models. John Wiley & Sons, New York, 2000.

Examples

Run this code
data("weibull")

n <- nrow(weibull)

## Number of classes or nearest neighbours to be processed.

K <- c(as.integer(1 + log2(sum(n))), ## Minimum v follows the Sturges rule.
  as.integer(10 * log10(n))) ## Maximum v follows the log10 rule.

## Estimate number of components, component weights and component parameters. 

weibullest <- REBMIX(Dataset = list(weibull),
  Preprocessing = "Parzen window", 
  D = 0.025, 
  cmax = 4,
  Criterion = "BIC", 
  Variables = "continuous",
  pdf = "Weibull", 
  K = K[1]:K[2], 
  Restraints = "loose")

## Plot finite mixture.

plot(weibullest, what = c("density", "distribution", "c", "IC", "logL", "D"), 
  nrow = 3, ncol = 2, npts = 1000)

## Bootstrap finite mixture.  

weibullboot <- boot(x = weibullest, Bootstrap = "nonparametric")

weibullboot

Run the code above in your browser using DataLab