| Title: | Finite Mixture Parametrization |
|---|---|
| Description: | A parametrization framework for finite mixture distribution using S4 objects. Density, cumulative density, quantile and simulation functions are defined. Currently normal, Tukey g-&-h, skew-normal and skew-t distributions are well tested. The gamma, negative binomial distributions are being tested. |
| Authors: | Tingting Zhan [aut, cre] (ORCID: <https://orcid.org/0000-0001-9971-4844>) |
| Maintainer: | Tingting Zhan <[email protected]> |
| License: | GPL-2 |
| Version: | 0.2.0 |
| Built: | 2026-05-28 14:46:47 UTC |
| Source: | https://github.com/tingtingzhan/fmx |
A parametrization framework for finite mixture distribution using S4 objects.
Density, cumulative density, quantile and simulation functions are defined.
Currently normal, Tukey -&-, skew-normal and skew-
distributions are well tested. The gamma, negative
binomial distributions are being tested.
Maintainer: Tingting Zhan [email protected] (ORCID)
Turn various objects created in other R packages to fmx class.
as.fmx(x, ...)as.fmx(x, ...)
x |
an R object |
... |
additional parameters, see Arguments in individual S3 dispatches |
Various mixture distribution estimates obtained from other R packages are converted to fmx class, so that we could take advantage of all methods defined for fmx objects.
S3 generic function as.fmx() returns an fmx object.
To create fmx object for finite mixture distribution.
fmx(distname, w = 1, ...)fmx(distname, w = 1, ...)
distname |
character scalar |
w |
(optional) numeric vector.
Does not need to sum up to 1; |
... |
mixture distribution parameters.
See function dGH for the names and default values of Tukey |
Function fmx() returns an fmx object.
An S4 object to specify the parameters and type of distribution of a one-dimensional finite mixture distribution.
distnamecharacter scalar,
name of parametric distribution of the mixture components.
Currently, normal ('norm') and Tukey -&- ('GH') distributions are supported.
parsdouble matrix,
all distribution parameters in the mixture.
Each row corresponds to one component. Each column includes the same parameters of all components.
The order of rows corresponds to the (non-strictly) increasing order of the component location parameters.
The columns match the formal arguments of the corresponding distribution,
e.g., 'mean' and 'sd' for Normal mixture,
or 'A', 'B', 'g' and 'h' for Tukey -&- mixture.
wdatadata.name(optional) character scalar, a human-friendly name of the observations
vcov_internal(optional) variance-covariance matrix of the internal (i.e., unconstrained) estimates
vcov(optional) variance-covariance matrix of the mixture distribution (i.e., constrained) estimates
dist.ks(optional) double scalar, Kolmogorov-Smirnov distance, via ks.test
dist.cvm(optional) double scalars, Cramer von Mises distance, via cvm.test
dist.kl(optional) double scalars, Kullback-Leibler distance
logdlogLik(optional) logLik object, log-likelihood