View source: R/fit_erlang_mixture.R
fit_erlang_mixture | R Documentation |
Fit an Erlang mixture using an ECME-Algorithm
fit_erlang_mixture(
dist,
obs,
start,
min_iter = 0L,
max_iter = 100L,
skip_first_e = FALSE,
tolerance = 1e-05,
trace = FALSE,
parallel = FALSE,
...
)
dist |
An |
obs |
Set of observations as produced by |
start |
Initial values of all placeholder parameters.
If missing, starting values are obtained from |
min_iter |
Minimum number of EM-Iterations |
max_iter |
Maximum number of EM-Iterations (weight updates) |
skip_first_e |
Skip the first E-Step (update Probability weights)? This can help if the initial values cause a mixture component to vanish in the first E-Step before the starting values can be improved. |
tolerance |
Numerical tolerance. |
trace |
Include tracing information in output?
If |
parallel |
Enable experimental parallel evaluation of expected log-likelihood? |
... |
Passed to |
A list with elements
params
the fitted parameters in the same structure as init
.
params_hist
(if trace
is TRUE) the history of parameters
(after each e- and m- step). Otherwise an empty list.
iter
the number of outer EM-iterations
logLik
the final log-likelihood
Other distribution fitting functions:
fit_blended()
,
fit_dist()
,
fit_mixture()
dist <- dist_erlangmix(list(NULL, NULL, NULL))
params <- list(
shapes = list(1L, 4L, 12L),
scale = 2.0,
probs = list(0.5, 0.3, 0.2)
)
x <- dist$sample(100L, with_params = params)
fit_erlang_mixture(dist, x, init = "kmeans")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.