View source: R/eglindley_mix.R
Inferences Generalized Lindley Mixture | R Documentation |
Estimates parameters of a univariate Generalized Lindley Mixture with k-means clustering and EM-algorithm.
eglindley_mix(data, g, lim.em = 100, criteria = "dif.psi", epsilon = 1e-05, plot.it = TRUE, empirical = FALSE, col.estimated = "orange", col.empirical = "navy", ...)
data |
vector containing the sample, or list obtained with rglindley_mix. |
g |
number of components in the mixture. |
lim.em |
limit of EM Iterations. |
criteria |
the stop criteria to be used, could be "dif.psi" to calculate differences on parameters matrix or "dif.lh" to calculate differences on Likelihood function. |
epsilon |
minimal difference value to algorithm stops. |
plot.it |
logical, TRUE to plot the histogram with estimated distribution curve. |
empirical |
logical, TRUE to add the empirical curve ("Kernel Density Estimation") in the plot. |
col.estimated |
a colour to be used in the curve of estimated density. |
col.empirical |
a colour to be used in the curve of empirical density. |
... |
further arguments and graphical parameters passed to hist. |
CASTRO, M. O.; MONTALVO, G. S. A.
## Generate a sample. data = rglindley_mix(n = 1000, pi = c(0.6, 0.4), alpha = c(10, 18), beta = c(1, 2), gamma = c(3, 4)) ## And now, estimate the parameters, using the 'data' list. eglindley_mix(data, g = 2, lim.em = 5) ## Or using the sample vector. # eglindley_mix(data$sample, g = 2, lim.em = 5) ## Using the diference in the log-likelihood as stop criteria. # eglindley_mix(data, g = 2, criteria = "dif.lh", lim.em = 10) ## Not plotting the graphic. # eglindley_mix(data, g = 2, plot.it = FALSE, lim.em = 5) ## Adding the empirical curve to the graphic. #eglindley_mix(data, g = 2, empirical = TRUE, lim.em = 5) ## Changing the color of the curves. # eglindley_mix(data, g = 2, lim.em = 5, empirical = TRUE, col.estimated = "pink", # col.empirical = "red3") ## Using "..." # eglindley_mix(data, g = 2, lim.em = 5, empirical = TRUE, col.estimated = "pink", # col.empirical = "red3", breaks = 300)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.