fit_blended {reservr} | R Documentation |
Fit a Blended mixture using an ECME-Algorithm
Description
Fit a Blended mixture using an ECME-Algorithm
Usage
fit_blended(
dist,
obs,
start,
min_iter = 0L,
max_iter = 100L,
skip_first_e = FALSE,
tolerance = 1e-05,
trace = FALSE,
...
)
Arguments
dist |
A |
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 |
... |
Passed to |
Value
A list with elements
-
params
the fitted parameters in the same structure asinit
. -
params_hist
(iftrace
is TRUE) the history of parameters (after each e- and m- step) -
iter
the number of outer EM-iterations -
logLik
the final log-likelihood
See Also
Other distribution fitting functions:
fit_dist()
,
fit_erlang_mixture()
,
fit_mixture()
Examples
dist <- dist_blended(
list(
dist_exponential(),
dist_genpareto()
)
)
params <- list(
probs = list(0.9, 0.1),
dists = list(
list(rate = 2.0),
list(u = 1.5, xi = 0.2, sigmau = 1.0)
),
breaks = list(1.5),
bandwidths = list(0.3)
)
x <- dist$sample(100L, with_params = params)
dist$default_params$breaks <- params$breaks
dist$default_params$bandwidths <- params$bandwidths
if (interactive()) {
fit_blended(dist, x)
}