Skip to contents

Read the report file from the ADMB version of the RE model (rwout.rep) and convert it into long format survey data estimates with CVs for input into REMA.

Usage

read_admb_re(
  filename,
  model_name = "Unnamed ADMB RE model",
  biomass_strata_names = NULL,
  cpue_strata_names = NULL
)

Arguments

filename

name of ADMB output file to be read (e.g. rwout.rep)

model_name

(optional) Name of stock and identifier for the ADMB version of the RE model. Defaults to 'ADMB RE'

biomass_strata_names

(optional) a vector of character names corresponding to the names of the biomass survey strata. Vector should be in the same order as the columns of srv_est in rwout.rep

cpue_strata_names

(optional) a vector of character names corresponding to the names of the CPUE survey strata. Vector should be in the same order as the columns of srv_est_LL in rwout.rep in the version of the ADMB RE model that accepts an additional survey index

Value

object of type "list" with biomass optional cpue survey data in long format, and initial parameter values for log_biomass_pred (the random effects matrix), ready for input into REMA

a list with the following items:

$biomass_dat

A dataframe of biomass survey data with strata, year, biomass estimates, and CVs. Note that the CVs have been back-transformed to natural space.

$cpue_dat

Optional dataframe of CPUE survey data with strata, year, CPUE estimates, and CVs. Note that the CVs have been back-transformed to natural space.

$model_yrs

Vector of prediction years.

$init_log_biomass_pred

Matrix of initial parameter values for log_biomass_pred (the random effects matrix), ready for input into REMA.

$admb_re_results

A list of ADMB RE model results ready for comparison with REMA models using compare_rema_models(). User beware... there are many, many versions of the RE.tpl in existence and individual variances may cause errors in this output.

Examples

if (FALSE) { # \dontrun{
# place holder for example code
} # }