Takes a non-primitive R function and refactors it to be compatible with
optimization via stats::optim
.
make_optim_function.Rd
Takes a non-primitive R function and refactors it to be compatible with optimization via stats::optim
.
Arguments
- fn
function
A non-primitive function- ...
Arguments to
fn
to fix for before building the function to be optimized. Useful for reducing the number of free parameters in an optimization if there are insufficient degrees of freedom.