Factored out code used in both stat_distrmix_line() and stat_distrmix_eq().
distrmix_helper_fun(
data,
aes.name = "x",
method,
method.name,
se,
method.args = list(),
k = 2,
free.mean = TRUE,
free.sd = TRUE,
n.min = 10L * k,
fit.seed = NA,
fm.values = TRUE,
verbose = getOption("verbose", default = FALSE)
)A layer specific dataset, only needed if you want to override the plot defaults.
function or character If character, "normalmixEM" or the
name of a model fit function are accepted, possibly followed by the fit
function's method argument separated by a colon. The function must return a
model fit object of class "mixEM".
logical If TRUE standard errors for the parameter estimates
are returned in addition to the parameter estimates.
named list with additional arguments. Not data
or weights which are always passed through aesthetic mappings.
integer Number of mixture components to fit.
logical If TRUE, allow the fitted mean and/or
fitted sd to vary among the component Normal distributions.
integer Minimum number of distinct values in the variable for
fitting to the attempted. The default depends on k.
RNG seed argument passed to
set.seed(). Defaults to NA, indicating
that set.seed() should not be called.
logical Add parameter estimates and their standard errors to the returned values (`FALSE` by default.)
If FALSE, capture screen output from method and display it
as a message() only in case of conversion failure.
This function does the model fitting and returns a data frame with the estimates for the parameters. It is a wrapper on functions from package 'mixtools'.
Other model-fitting helper functions:
quant_helper_fun()