Retrieve the result of a background fit

Description

Blocks until the background fit started by [ferx_fit_async](ferx_fit_async.qmd)completes, optionally printing live optimizer trace progress to the console. Pressing Ctrl+C cancels the wait and kills the background process; NULL is returned.

Usage

ferx_collect(handle, verbose = TRUE)

Arguments

  • handle: A ferx_job handle returned by [ferx_fit_async](ferx_fit_async.qmd).
  • verbose: Logical. Whether to print optimizer trace progress while waiting. Default TRUE.

Errors

If the background fit itself errors (e.g. bad model file, engine failure), ferx_collect() re-throws the error in the calling session.

Seealso

Other fitting: [ferx_check_init](ferx_check_init.qmd)(), [ferx_fit](ferx_fit.qmd)(), [ferx_fit_async](ferx_fit_async.qmd)(), [ferx_inits_from_nca](ferx_inits_from_nca.qmd)(), [ferx_sir](ferx_sir.qmd)()

Concept

fitting

Value

The ferx_fit object produced by the background fit. Returns NULL if the user interrupts.

Examples

ex <- ferx_example("warfarin")
handle <- ferx_fit_async(ex$model, ex$data, method = "focei")
fit <- ferx_collect(handle)
summary(fit)