View source: R/gaussian_mixture.R
| gaussian_mixture_em | R Documentation |
Fits a K-component univariate Gaussian mixture using the same EM algorithm
bundled with CharAnalysis v1.1 and v2.0 (Bowman CLUSTER implementation).
Replicates three key behaviours that distinguish it from mclust:
gaussian_mixture_em(x, k = 2L)
x |
Numeric vector of observations (the C_peak values in the window). |
k |
Integer number of components (default 2). |
First/last-point initialisation: for K = 2, component
means are seeded at the first and last elements of the input data
vector (not at sorted min/max; the data are in time order). This is
the initMixture() behaviour from MATLAB.
Loose convergence criterion: EM stops when the per-step
log-likelihood gain falls to or below
\epsilon = 0.01 \times L_c \times \log N where L_c = 3
for univariate data. This is much looser than the mclust
default (10^{-5}) and causes MATLAB to freeze closer to the
initial configuration.
Variance regularisation: a small floor
R_{\min} = \bar{\sigma}^2 / 10^5 is added to each component
variance after every M-step, preventing degenerate (zero-variance)
solutions.
Because CharAnalysis always calls GaussianMixture(X, 2, 2, false)
(i.e.\ finalK = initK = 2), the MDLReduceOrder() path is
never exercised and is therefore not implemented here.
Named list:
Numeric vector length k: component means sorted
ascending.
Numeric vector length k: component standard
deviations (= sqrt of fitted variance), sorted to match mu.
Numeric vector length k: mixing proportions, sorted
to match mu.
Scalar: log-likelihood at convergence.
[char_thresh_local()], [char_thresh_global()]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.