broom (version 0.3.7)

optim_tidiers: Tidiers for lists returned from optim

Description

Tidies objects returned by the optim function for general-purpose minimization and maximization.

Usage

tidy_optim(x, ...)

glance_optim(x, ...)

Arguments

x
list returned from optim
...
extra arguments

Value

  • 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

  • parametername of the parameter, or parameter1, parameter2... if the input vector is not named
  • valueparameter value that minimizes or maximizes the output
  • glance returns a one-row data frame with the columns
  • valueminimized or maximized output value
  • function.countnumber of calls to fn
  • gradient.countnumber of calls to gr
  • convergenceconvergence code representing the error state

See Also

optim

Examples

Run this code
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