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.
Currently ignored.
named list with additional arguments.
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 mapped variable for fitting to the attempted.
RNG seed argument passed to set.seed().
Defaults to NA, which means that set.seed() will 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'.