Takes a non-primitive R function and refactors it to be compatible with optimization via stats::optim.
make_optim_function.RdTakes a non-primitive R function and refactors it to be compatible with optimization via stats::optim.
Arguments
- fn
functionA non-primitive function- ...
Arguments to
fnto 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.