Skip to contents

Get 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.

Usage

computations(object)

Arguments

object

A fitted object of class "bage_mod".

Value

A tibble with the following variables:

  • time_total Total duration, in seconds, of the fitting process.

  • time_optim Time used by optimizer (stats::nlminb())

  • time_draws Time used drawing drawing from multivariate normal

  • iter Number of iterations required by stats::nlminb()

  • message Message about convergence returned by stats::nlminb().

See also

Examples

mod <- mod_pois(divorces ~ age + sex + time,
                data = nzl_divorces,
                exposure = population) |>
  fit()

computations(mod)
#> # A tibble: 1 × 6
#>   time_total time_optim time_draws  iter converged message                 
#>        <dbl>      <dbl>      <dbl> <int> <lgl>     <chr>                   
#> 1      0.114     0.0444    0.00363    11 TRUE      relative convergence (4)