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_cor_matrix](ferx_cor_matrix.qmd)(), [ferx_cov_screen](ferx_cov_screen.qmd)(), [ferx_estimates](ferx_estimates.qmd)(), [ferx_eta_cov](ferx_eta_cov.qmd)(), [ferx_plot_trace](ferx_plot_trace.qmd)(), [ferx_runlog_iters](ferx_runlog_iters.qmd)(), [ferx_warnings](ferx_warnings.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)