fmx_hybrid {QuantileGH}R Documentation

Best Naive Estimates for Finite Mixture Distribution

Description

Best estimates for finite mixture distribution fmx.

Usage

fmx_hybrid(x, test = c("logLik", "CvM", "KS"), ...)

Arguments

x

numeric vector, observations

test

character scalar, criteria for selecting the optimal estimates. See Details.

...

additional parameters of functions fmx_normix and fmx_cluster

Details

Function fmx_hybrid compares Tukey g-&-h mixture estimate provided by function fmx_cluster and the normal mixture estimate by function fmx_normix, and select the one either with maximum likelihood (test = 'logLik', default), with minimum Cramer-von Mises distance (test = 'CvM') or with minimum Kolmogorov distance (Kolmogorov_fmx).

Value

Function fmx_hybrid returns an fmx object.

Examples

library(fmx)
d1 = fmx('norm', mean = c(1, 2), sd = .5, w = c(.4, .6))
set.seed(100); hist(x1 <- rfmx(n = 1e3L, dist = d1))
fmx_normix(x1, distname = 'norm', K = 2L)
fmx_normix(x1, distname = 'GH', K = 2L)

(d2 = fmx('GH', A = c(1,6), B = 2, g = c(0,.3), h = c(.2,0), w = c(1,2)))
set.seed(100); hist(x2 <- rfmx(n = 1e3L, dist = d2))
fmx_cluster(x2, K = 2L)
fmx_cluster(x2, K = 2L, constraint = c('g1', 'h2'))
fmx_normix(x2, K = 2L, distname = 'GH')
fmx_hybrid(x2, distname = 'GH', K = 2L)


[Package QuantileGH version 0.1.7 Index]