optim_save: Warpper to optim to save iterations.

View source: R/optim_save.R

optim_saveR Documentation

Warpper to optim to save iterations.

Description

This function wraps the stats::optim() function and saves the parameters and likelihood estimation at each step of the algorithm.

Usage

optim_save(par, fn, ...)

Arguments

par

initial parameters to to be optimized over.

fn

the function to minimized (or maximized).

...

other parameters passed to optim.

Value

the results of optim with two additional elements, iterations with a a list of the values at each iteration of the algorithm and iterations_df which is a data.frame version of the list.


jbryer/VisualStats documentation built on Feb. 27, 2025, 6:19 p.m.