summarize_MCBE: Summarize results from MCBE uncertainty analysis

View source: R/summarize_MCBE.R

summarize_MCBER Documentation

Summarize results from MCBE uncertainty analysis

Description

Summarize results from MCBE uncertainty analysis

Usage

summarize_MCBE(
  dir_bam_sim = "sim",
  dir_bam_base = "base",
  fileName = "bam",
  nm_model = "",
  obj_collect = c("info", "parms", "like", "spr.brps", "mse", "a.series", "t.series",
    "parm.cons", "N.age", "Z.age", "sel.age"),
  obj_labels = list(parm.cons = c("init", "lower", "upper", "phase", "prior_mean",
    "prior_var", "prior_pdf", "result")),
  nm_Fref = c("F40", "Fref"),
  ncores = NULL
)

Arguments

dir_bam_sim

Name of directory where run_MCBE results files are stored, relative to the working directory.

dir_bam_base

Name of directory where base (i.e. reference) model results are stored, relative to the working directory.

fileName

Name given to BAM base run files, not including file extensions

nm_model

character string indicating the model name as part of the MCBE file names. For example, "bam" is the nm_model in "1-bam.rdat". This optional argument should be specified if there are .rdat files in dir_bam_sim other than the MCBE output files. Otherwise, this function will try to read all .rdat files.

obj_collect

Names of objects in MCBE rdat files to collect and summarize

obj_labels

list of names for each value of each parameter in parm.cons

nm_Fref

Name of F alternative F reference point to use for calculating Fref.65, Fref.75, and Fref.85. There is surely a better way to do those calculations, but this is the current method.

ncores

number of cores to use for parallel processing

Details

This function also runs the bamExtras::check_bounds function on the rdat for each simulation and adds the logical value nearbound to the rdat$parms indicating if any parameters were near the bounds.

Value

list of summarized outputs, most of which are named similar to typical BAM output (rdat) files. This list can be passed to plot_MCBE to make a variety of useful plots

Examples

## Not run: 
# Run MCBE, writing files to dir_bam_sim
run_MCBE("GrayTriggerfish", dir_bam_sim="GrTr_sim", dir_bam_base="GrTr_base")
# Summarize results of MCBE and assign to object
MCBE_GrTr <- summarize_MCBE(dir_bam_sim="sim_GrTr")

## End(Not run)

nikolaifish/bamExtras documentation built on April 17, 2025, 9:44 p.m.