Read the optimizer trace from a ferx fit

Description

Reads the per-iteration trace CSV written when optimizer_trace = TRUEwas passed to [ferx_fit](ferx_fit.qmd). Returns a tidy data frame with one row per optimizer iteration (or per OFV evaluation for NLopt-based methods).

Usage

ferx_trace(fit)

Arguments

  • fit: Optional. A ferx_fit object returned by [ferx_fit](ferx_fit.qmd), or a character string giving the path to a trace CSV file written by ferx. If omitted, uses the trace from the last ferx_fit() call in this session.

Details

Called with no argument, returns the trace from the most recent ferx_fit() call in the current R session and prints a one-line message indicating when that fit was started. Named ferx_trace()rather than trace() to avoid masking base::trace().

Seealso

Other diagnostics: [check_diagnostics](check_diagnostics.qmd), [ferx_conddist](ferx_conddist.qmd), [ferx_cov_screen](ferx_cov_screen.qmd), [ferx_get_warnings](ferx_get_warnings.qmd), [ferx_runlog_iters](ferx_runlog_iters.qmd), [plot.ferx_fit](plot.ferx_fit.qmd), [summary.ferx_fit](summary.ferx_fit.qmd)

Concept

diagnostics

Value

A data frame with columns:

Examples

ex  <- ferx_example("warfarin")
fit <- ferx_fit(ex$model, ex$data, method = "gn", covariance = FALSE,
                optimizer_trace = TRUE)
tr  <- ferx_trace(fit)
head(tr)