norMix {nor1mix} | R Documentation |
Objects of class norMix
represent finite mixtures of
(univariate) normal (aka Gaussian) distributions. Methods for
construction, printing, plotting, and basic computations are provided.
norMix(mu, sig2 = rep(1,m), w = NULL, name = NULL, long.name = FALSE) is.norMix(obj) m.norMix(obj) var.norMix(x, ...) ## S3 method for class 'norMix': mean(x, ...) ## S3 method for class 'norMix': print(x, ...)
mu |
numeric vector of length K, say, specifying the means μ of the K normal components. |
sig2 |
numeric vector of length K, specifying the variances σ^2 of the K normal components. |
w |
numeric vector of length K, specifying the mixture proportions p[j] of the normal components, j = 1,...,K. Defaults to equal proportions |
name |
optional name tag of the result (used for printing). |
long.name |
logical indicating if the name attribute
should use punctuation and hence be slightly larger than by default. |
obj,x |
an object of class norMix . |
... |
further arguments passed to methods. |
The (one dimensional) normal mixtures, R objects of class
"norMix"
, are constructed by norMix
and tested for by
is.norMix
. m.norMix()
returns the number of mixture
components; the mean()
method (for class "norMix"
returns the mu
vector of means and var.norMix()
(not a
method, call the function explicitly!) the sig2
vector of
variances.
For further methods see below.
norMix
returns objects of class "norMix"
which are
currently implemented as 3-column matrix with column names mu
,
sig2
, and w
, and further attributes.
The user should rarely need to access the underlying structure
directly.
For estimation of the parameters of a normal mixture distribution, I recommend using other R packages, such as flexmix.
Martin Maechler
dnorMix
for the density,
pnorMix
for the cumulative distribution
and the quantile function (qnorMix
), and
rnorMix
for random numbers and
plot.norMix
, the plot method.
MarronWand
has the Marron-Wand densities as normal mixtures.
ex <- norMix(mu = c(1,2,5))# s^2 = 1, equal proportions ex plot(ex)# looks like a mixture of only 2 plot(ex, log = "y")# maybe "revealing"