plot_profile: Plot results from MCBE parameter profile analysis

View source: R/plot_profile.R

plot_profileR Documentation

Plot results from MCBE parameter profile analysis

Description

Plot results from MCBE parameter profile analysis

Usage

plot_profile(
  sim_summary,
  nm_par = "steep",
  nm_obj = c("parms", "parm.cons"),
  like_pattern = "^lk.",
  like_groups = c("L", "D", "U", "lenc", "agec", "SR"),
  like_shift = "min_par",
  like_exclude = c("lk.unwgt.data", "lk.Nage.init", "lk.fullF", "lk.Ftune", "lk.SRearly",
    "lk.SRend"),
  like_exclude_stacked = c("lk.total", "lk.unwgt.data"),
  like_plot_last = "lk.total",
  par_args = list(mfrow = c(2, 1), mar = c(3, 3, 0, 0), mgp = c(1, 0.3, 0), tck = -0.01),
  matplot_args_all = list(),
  matplot_args_group = list(),
  plot_profiles = TRUE,
  plot_stacked = TRUE,
  filter_info = list(gradient.max = c(0, 0.01)),
  par_val_ref = NULL,
  col_sub = c(total = rgb(0, 0, 0))
)

Arguments

sim_summary

Output object from summarize_MCBE

nm_par

Name of parameter to plot profile

nm_obj

Name of object where par should be found in sim_summary. By default, plot_profile will look in parms and parm.cons and use the first instance of nm_par it finds. It works with data frames in sim_summary like parms and is programmed to work with parm.cons as a special case, but may not work with other objects within sim_summary.

like_pattern

pattern to use to identify likelihood components from like object in sim_summary. Internally, the function uses grepl to identify names in like. The default "^lk." uses regular expression to identify all likelihood components.

like_groups

names of groups to use when plotting grouped likelihoods. The function adds "^lk." to the group names to find parameters to group in like.

like_shift

method to use to scale likelihood components for plotting: "min" shifts each likelihood component by the overall minimum, "min_par" shifts each likelihood component by its own minimum, "none" returns raw likelihoods

like_exclude

Names of columns in like to exclude from plotting profiles

like_exclude_stacked

Names of columns in like to exclude from plotting stacked barplot

like_plot_last

Name of the likelihood component to plot last so that it is on top in the plots.

par_args

arguments to pass to par

matplot_args_all

arguments to pass to matplot for plot of all likelihoods

matplot_args_group

arguments to pass to matplot for plot of grouped likelihoods

plot_profiles

logical. Plot likelihood profiles as lines, possibly shifted with like_shift.

plot_stacked

logical. Plot likelihood profiles as stacked areas (ggplot) columns not in like_prop_exclude.

filter_info

list of ranges used to filter out sim runs. set to NULL to retain all results.

par_val_ref

reference value to add to profile plots (e.g. parameter value from base model)

col_sub

Specify colors to substitute for colors in the ungrouped profile plot. named vector where the names match the names match the names in the plot legend.


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