summary.optimx.RdSummarize an "optimx" object.
# S3 method for class 'optimx'
summary(object, order = NULL, par.select = TRUE, ...)Object returned by optimx.
A column name, character vector of columns names, R
expression in terms of column names or a list of R expressions in terms of
column names. NULL, the default, means no re-ordering.
rownames can be used to
alphabetic ordering by method name.
NULL, the default, causes
it not to be reordered. Note that if
follow.on is TRUE re-ordering likely makes no sense.
The result is ordered by the order
specification, each specified column in ascending order (except for
value which is in descending order if the optimization problem is a
maximization problem).
a numeric, character or logical vector selecting
those par values to display. For example, par=1:5 means
display only the first 5 parameters. Recycled so par.select=FALSE
selects no parameters.
Further arguments to be passed to the function. Currently not used.
If order is specified then the result is reordered by the specified
columns, each in ascending order (except possibly for the
value column which is re-ordered in descending order for
maximization problems).
summary.optimx returns object with the rows ordered according
to order and with those parameters selected by par.select.
ans <- optimx(fn = function(x) sum(x*x), par = 1:2)
# order by method name.
summary(ans, order = rownames)
#> p1 p2 value fevals gevals niter
#> BFGS 2.228468e-13 -1.109715e-13 6.357087e-26 9 3 NA
#> Nelder-Mead 1.274686e-04 1.447624e-04 3.720441e-08 65 NA NA
#> convcode kkt1 kkt2 xtime
#> BFGS 0 TRUE TRUE 0
#> Nelder-Mead 0 TRUE TRUE 0
# order by objective value. Do not show parameter values.
summary(ans, order = value, par.select = FALSE)
#> value fevals gevals niter convcode kkt1 kkt2 xtime
#> BFGS 6.357087e-26 9 3 NA 0 TRUE TRUE 0
#> Nelder-Mead 3.720441e-08 65 NA NA 0 TRUE TRUE 0
# order by objective value and then number of function evaluations
# such that objectives that are the same to 3 decimals are
# considered the same. Show only first parameter.
summary(ans, order = list(round(value, 3), fevals), par.select = 1)
#> p1 value fevals gevals niter convcode kkt1 kkt2
#> BFGS 2.228468e-13 6.357087e-26 9 3 NA 0 TRUE TRUE
#> Nelder-Mead 1.274686e-04 3.720441e-08 65 NA NA 0 TRUE TRUE
#> xtime
#> BFGS 0
#> Nelder-Mead 0