Skip to contents

Combines population time series with uncertainty from tidy_sdrep() and age-specific estimates and other reported quantities from tidy_rep() into a single named list for downstream plotting and summaries. SSB includes a timing label and the common spawning fraction for each year. Its fraction is NA when ages have different spawning times; the full timing table remains in the fitted data and dashboard settings.

Usage

tidy_pop(fit, interval = 0.95)

Arguments

fit

A fitted TAM object as returned by fit_tam().

interval

Confidence level for intervals passed to tidy_sdrep(); default 0.95.

Value

A named list containing the elements returned by tidy_sdrep() and tidy_rep() (names preserved).

Examples

fit <- fit_tam(
  cod_obs,
  years = 1983:2024,
  ages = 2:14,
  N_settings = list(process = "iid", init = "exp"),
  F_settings = list(process = "rw", mu_form = NULL),
  M_settings = list(process = "off", mu_supplied = ~ I(0.3)),
  catch_settings = list(sd_form = ~ 1),
  index_settings = list(sd_form = ~ 1, q_form = ~ q_block),
  silent = TRUE
)
pop <- tidy_pop(fit)
names(pop)
#>  [1] "F_full"           "recruitment"      "abundance"        "biomass"         
#>  [5] "ssb"              "F_bar"            "M_bar"            "N_plus"          
#>  [9] "P"                "W"                "W_catch"          "N"               
#> [13] "M"                "mu_M"             "F"                "mu_F"            
#> [17] "S"                "Z"                "biomass_mat"      "ssb_mat"         
#> [21] "total_catch"      "total_catch_pred" "total_yield"      "total_yield_pred"