Learn R Programming

QuantileGH (version 0.1.8)

QLMDe_stepK: Forward Selection of the Number of Components \(K\)

Description

To compare \(gh\)-parsimonious models of Tukey \(g\)-&-\(h\) mixtures with different number of components \(K\) (up to a user-specified \(K_\text{max}\)) and select the optimal number of components.

Usage

QLMDe_stepK(
  x,
  distname = c("GH", "norm"),
  data.name = deparse1(substitute(x)),
  Kmax = 3L,
  test = c("BIC", "AIC"),
  direction = c("forward", "backward"),
  ...
)

Value

Function QLMDe_stepK() returns an object of S3 class 'stepK', which is a list of selected models (in reversed order) with attribute(s) 'direction' and 'test'.

Arguments

x

numeric vector, observations

distname, data.name

character scalars, see parameters of the same names in function QLMDe()

Kmax

integer scalar \(K_\text{max}\), maximum number of components to be considered. Default 3L

test

character scalar, criterion to be used, either Akaike's information criterion AIC, or Bayesian information criterion BIC (default).

direction

character scalar, direct of selection in function step_fmx(), either 'forward' (default) or 'backward'

...

additional parameters

Details

Function QLMDe_stepK() compares the \(gh\)-parsimonious models with different number of components \(K\), and selects the optimal number of components using BIC (default) or AIC.

The forward selection starts with finding the \(gh\)-parsimonious model (via function step_fmx()) at \(K = 1\). Let the current number of component be \(K^c\). We compare the \(gh\)-parsimonious models of \(K^c+1\) and \(K^c\) component, respectively, using BIC or AIC. If \(K^c\) is preferred, then the forward selection is stopped, and \(K^c\) is considered the optimal number of components. If \(K^c+1\) is preferred, then the forward selection is stopped if \(K^c+1=K_{max}\), otherwise update \(K^c\) with \(K_c+1\) and repeat the previous steps.

Examples

Run this code
data(bmi, package = 'mixsmsn')
hist(x <- bmi[[1L]])
QLMDe_stepK(x, distname = 'GH', Kmax = 2L)

Run the code above in your browser using DataLab