fit.mixture.model | R Documentation |
Fit a Gaussian mixture deconvolution model
fit.mixture.model(
z,
n = 2,
ntry = 20,
force.mu.zero = TRUE,
diagnostics = FALSE
)
z |
A vector of z-scores. |
n |
Number of mixture components. |
ntry |
Number of random initializations. |
force.mu.zero |
Should the means be forced to zero? |
diagnostics |
Logical indicator for showing diagnostic plots. |
This function assumes that z
is distributed as N(\gamma, 1)
and \gamma
follows a Gaussian mixture model. It fits this deconvolution model by maximum likelihood and outputs the estimated mixture distribution.
A list of p
(mixture proportion), mu
(mean), sigma
(standard deviation).
z <- c(sqrt(2) * rnorm(900), sqrt(17) * rnorm(100))
## So the correct sigma = (1, 4) and p = (0.9, 0.1)
fit.mixture.model(z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.