Information on Computations Performed During Model Fitting
Source:R/bage_mod-methods.R
computations.RdGet information on computations performed by function fit().
The information includes the total time used for fitting, and
the time used for two particular tasks that can be slow:
running the optimizer stats::nlminb(),
and drawing from the multivariate normal returned
by the TMB. It also includes values returned by the optimizer:
the number of iterations needed, and messages about convergence.
Value
A tibble with the following variables:
time_totalSeconds used for whole fitting process.time_maxSeconds used for optimisiation.time_drawSeconds used by functionTMB::sdreport().iterNumber of iterations required for optimization.messageMessage about convergence returned by optimizer.
See also
mod_pois(),mod_binom(),mod_norm()Specify a modelfit()Fit a modeltidy()Summarise a modelset_n_draw()Specify number of posterior draws
Examples
mod <- mod_pois(divorces ~ age + sex + time,
data = nzl_divorces,
exposure = population) |>
fit()
#> Building log-posterior function...
#> Finding maximum...
#> Drawing values for hyper-parameters...
computations(mod)
#> # A tibble: 1 × 6
#> time_total time_max time_draw iter converged message
#> <dbl> <dbl> <dbl> <int> <lgl> <chr>
#> 1 0.196 0.0937 0.0821 13 TRUE relative convergence (4)