Last chance! 50% off unlimited learning
Sale ends in
powered by
Tidies objects returned by the optim function for general-purpose minimization and maximization.
optim
tidy_optim(x, ...)glance_optim(x, ...)
glance_optim(x, ...)
list returned from optim
extra arguments
All tidying methods return a data.frame without rownames, whose structure depends on the method chosen.
tidy returns a data frame with one row per parameter that was estimated, with columns
tidy
name of the parameter, or parameter1, parameter2... if the input vector is not named
parameter1
parameter2
parameter value that minimizes or maximizes the output
glance returns a one-row data frame with the columns
minimized or maximized output value
number of calls to fn
fn
number of calls to gr
gr
convergence code representing the error state
# NOT RUN { func <- function(x) { (x[1] - 2)^2 + (x[2] - 3)^2 + (x[3] - 8)^2 } o <- optim(c(1, 1, 1), func) tidy(o) glance(o) # }
Run the code above in your browser using DataLab