Optimise a function using either numerical optimisation or grid search
.fit(func, fit_method = c("optim", "grid"), ...)
A single numeric
.
A function
.
A character
string, either "optim"
or "grid"
.
<dynamic-dots
> Named elements to replace
default optimisation settings for either optim()
or grid search. See
details.
Arguments passed through dots depend on whether fit_method
is set to
"optim"
or "grid"
. For "optim"
, arguments are passed to optim()
,
for "grid"
, the variable arguments are lower
, upper
(lower and
upper bounds on the grid search for the parameter being optimised, defaults
are lower = 0.001
and upper = 0.999
), and "res"
(the resolution of
grid, default is res = 0.001
).