From c49ae1dd94e67109c2719ae5c966be927801f88a Mon Sep 17 00:00:00 2001 From: chantelwetzel-noaa Date: Wed, 2 Oct 2024 18:46:28 +0000 Subject: [PATCH] Built site for nwfscDiag@1.1.2: 7433626 --- .nojekyll | 1 + 404.html | 103 ++++++++ articles/index.html | 76 ++++++ articles/nwfscDiag.html | 333 ++++++++++++++++++++++++ authors.html | 98 +++++++ bootstrap-toc.css | 60 +++++ bootstrap-toc.js | 159 ++++++++++++ docsearch.css | 148 +++++++++++ docsearch.js | 85 ++++++ index.html | 162 ++++++++++++ link.svg | 12 + pkgdown.css | 384 ++++++++++++++++++++++++++++ pkgdown.js | 108 ++++++++ pkgdown.yml | 6 + reference/check_profile_range.html | 108 ++++++++ reference/get_jitter_quants.html | 112 ++++++++ reference/get_param_values.html | 116 +++++++++ reference/get_retro_quants.html | 123 +++++++++ reference/get_settings.html | 227 ++++++++++++++++ reference/get_settings_profile.html | 193 ++++++++++++++ reference/get_summary.html | 117 +++++++++ reference/index.html | 161 ++++++++++++ reference/jitter_wrapper.html | 117 +++++++++ reference/pipe.html | 99 +++++++ reference/plot_jitter.html | 112 ++++++++ reference/plot_profile.html | 122 +++++++++ reference/plot_retro.html | 116 +++++++++ reference/pngfun.html | 109 ++++++++ reference/pretty_decimal.html | 120 +++++++++ reference/profile_wrapper.html | 134 ++++++++++ reference/rerun_profile_vals.html | 172 +++++++++++++ reference/retro_wrapper.html | 135 ++++++++++ reference/round_any.html | 99 +++++++ reference/run_diagnostics.html | 115 +++++++++ reference/run_jitter.html | 110 ++++++++ reference/run_profile.html | 140 ++++++++++ reference/run_retro.html | 135 ++++++++++ sitemap.xml | 31 +++ 38 files changed, 4758 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 articles/index.html create mode 100644 articles/nwfscDiag.html create mode 100644 authors.html create mode 100644 bootstrap-toc.css create mode 100644 bootstrap-toc.js create mode 100644 docsearch.css create mode 100644 docsearch.js create mode 100644 index.html create mode 100644 link.svg create mode 100644 pkgdown.css create mode 100644 pkgdown.js create mode 100644 pkgdown.yml create mode 100644 reference/check_profile_range.html create mode 100644 reference/get_jitter_quants.html create mode 100644 reference/get_param_values.html create mode 100644 reference/get_retro_quants.html create mode 100644 reference/get_settings.html create mode 100644 reference/get_settings_profile.html create mode 100644 reference/get_summary.html create mode 100644 reference/index.html create mode 100644 reference/jitter_wrapper.html create mode 100644 reference/pipe.html create mode 100644 reference/plot_jitter.html create mode 100644 reference/plot_profile.html create mode 100644 reference/plot_retro.html create mode 100644 reference/pngfun.html create mode 100644 reference/pretty_decimal.html create mode 100644 reference/profile_wrapper.html create mode 100644 reference/rerun_profile_vals.html create mode 100644 reference/retro_wrapper.html create mode 100644 reference/round_any.html create mode 100644 reference/run_diagnostics.html create mode 100644 reference/run_jitter.html create mode 100644 reference/run_profile.html create mode 100644 reference/run_retro.html create mode 100644 sitemap.xml diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.nojekyll @@ -0,0 +1 @@ + diff --git a/404.html b/404.html new file mode 100644 index 0000000..9dd5d73 --- /dev/null +++ b/404.html @@ -0,0 +1,103 @@ + + + + + + + +Page not found (404) • nwfscDiag + + + + + + + + + + + +
+
+ + + + +
+
+ + +Content not found. Please use links in the navbar. + +
+ + + +
+ + + +
+ +
+

+

Site built with pkgdown 2.1.1.

+
+ +
+
+ + + + + + + + diff --git a/articles/index.html b/articles/index.html new file mode 100644 index 0000000..d657d8e --- /dev/null +++ b/articles/index.html @@ -0,0 +1,76 @@ + +Articles • nwfscDiag + + +
+
+ + + +
+
+ + +
+

All vignettes

+

+ +
nwfscDiag
+
+
+
+
+ + +
+ +
+

Site built with pkgdown 2.1.1.

+
+ +
+ + + + + + + + diff --git a/articles/nwfscDiag.html b/articles/nwfscDiag.html new file mode 100644 index 0000000..45a0533 --- /dev/null +++ b/articles/nwfscDiag.html @@ -0,0 +1,333 @@ + + + + + + + +nwfscDiag • nwfscDiag + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +
+

nwfscDiag: Diagnostic Package for West Coast Groundfish +Assessments +

+

The package provides the functionality to conduct model diagnostics +for Stock Synthesis (SS3) models. The standard diagnostic included in +this package are standard required analysis for U.S. West Coast +Groundfish stock assessments managed by the Pacific Fisheries Management +Council. The package was designed to perform model diagnostics and +create plots and tables in a standardized format. The standardized +approach will facilitate the use of these outputs in the assessment +template approach.

+

The diagnostics created by the package are: - jitter runs to ensure +model convergence at the Maximum Likelihood Estimate (MLE), - +retrospective runs to examine model sensitivity to recent data, +and
+- likelihood profiles across parameters.

+

This package does not maintain backward compatibility with previous +versions of Stock Synthesis. However, if needed user can download older +package versions that may work with older versions (3.30.+) of Stock +Synthesis.

+
+

Installation +

+

nwfscDiag can be installed via github:

+
install.packages("remotes")
+remotes::install_github("pfmc-assessments/nwfscDiag")
+
+
+

Running the code +

+

The package depends upon a few other packages and they should be +installed upon installation of the package. The dependent packages +are:

+
install.packages('dplyr')
+remotes::install_github('r4ss/r4ss')
+

A new version of r4ss package was released on July 29, 2022 that +included some significant changes that are required for the current +version of nwfscDiag to run. The current version of the +nwfscDiag 1.1.2 package is designed to work with the latest release of +r4ss. Please see release version 1.0.1 to use earlier versions of +r4ss.

+
+
+

Example: Run all diagnostics +

+

First, you should specify the directory where the base model is +located and where the diagnostics will be run and the name of the base +model folder:

+
library(nwfscDiag)
+directory <- "C:/your directory"
+base_model_name <- "base model"
+

Another way to do handle directory management is by using a project +file and the here package:

+
directory <- here::here("models")
+base_model_name <- "base model"
+

The get_settings_profile() specifies which parameters to +run a profile for and the parameter ranges for each profile. The low and +high values can be specified in 3 ways:

+
    +
  • as a ‘multiplier’ where a percent where the low and high range will +be specified as x% of the base parameter (i.e., (base parameter - base +parameter* x) - (base parameter + base parameter * x)),
  • +
  • in ‘real’ space where the low and high values are in the parameter +space, and
  • +
  • as ‘relative’ where the low and high is a specified amount relative +to the base model parameter (i.e., (base parameter - x) - (base +parameter + x).
  • +
+

Specify the parameters to profile over along with the parameter range +and step size:

+
profile_info <- get_settings_profile( 
+  parameters =  c("NatM_uniform_Fem_GP_1", "SR_BH_steep", "SR_LN(R0)"),
+  low =  c(0.40, 0.25, -2),
+  high = c(0.40, 1.0,  2),
+  step_size = c(0.005, 0.05, 0.25),
+  param_space = c('multiplier', 'real', 'relative')
+  )
+

The parameters function argument specifies the +parameters to profile over where the string provided should match the +string label in the SS3 control file. The low, +high, step_size, and param_space +inputs should be vectors of equal length to the parameters +input. The above example will profile over female natural mortality, +steepness, and +R0R_0. +The female natural mortality parameter profile will range from (base +parameter - base parameter* x) to (base parameter + base parameter * x) +in steps of 0.005, the steepness parameter profile will range from 0.25 +to 1.0 in step size of 0.05, and the +R0R_0 +parameter profile will range from +(R0R_0 +- 0.25) to +(R0R_0 ++ 0.25) in step size of 0.25.

+

Next the settings for running the profiles, jitter, and +retrospectives within r4ss needs to be specified using +get_settings():

+
model_settings <- get_settings(
+  settings = list(
+    base_name = base_model_name,
+      run = c("jitter", "profile", "retro"),
+      profile_details = profile_info )
+    )
+

where the above example requests jitters, profiles, and retrospective +models to be run for the model file specified above as the +base_model_name with the profile setting set using +get_settings_profile() above. Calling +model_settings in the R terminal will show all default +settings.

+

If profile is included in the run requested and +verbose = TRUE in the model_settings() the +values for each parameter profiled across will be printed to the screen. +Reviewing this information prior to running all diagnostics can be +useful to ensure the parameter range and step size was set +correctly.

+

Run all diagnostics:

+
run_diagnostics(mydir = directory, model_settings = model_settings)
+
+
+

Example: Run a single profile +

+
library(nwfscDiag)
+directory <- here::here("models")
+base_model_name <- "base model"
+
+profile_settings <- get_settings_profile( 
+  parameters =  c("SR_BH_steep"),
+    low =  c(0.25),
+    high = c(1.0),
+    step_size = c(0.05),
+    param_space = c('real')
+    )
+
+model_settings <- get_settings(
+  settings = list(
+    base_name = base_model_name,
+        run = "profile",
+        profile_details = profile_settings)
+    )
+
+run_diagnostics(mydir = directory, model_settings = model_settings)
+
+
+

Example: Run jitters +

+
library(nwfscDiag)
+directory <- here::here("models")
+base_model_name <- "base model"
+
+model_settings <- get_settings(
+  settings = list(
+    base_name = base_model_name,
+        run = "jitter",
+        Njitter = 100,
+        jitter_fraction = 0.10)
+    )
+
+run_diagnostics(mydir = directory, model_settings = model_settings)
+
+
+

Example: Run retrospectives +

+
library(nwfscDiag)
+directory <- here::here("models")
+base_model_name <- "base model"
+
+model_settings <- get_settings(
+  settings = list(
+    base_name = base_model_name,
+        run = "retro",
+        retro_yrs = -1:-10)
+    )
+
+run_diagnostics(mydir = directory, model_settings = model_settings)
+
+
+

Example: Rerun select values for a profile +

+

There are instances where not all models runs within a parameter +profile converge. In this case one needs to rerun only select models +that failed to converge in the profile. The +rerun_profile_vals() function allows users to do this.

+
library(nwfscDiag)
+directory <- here::here("models")
+base_model_name <- "base model"
+rerun_profile_vals(
+  mydir = file.path(model_dir, base_name),
+  model_settings = model_settings,
+  para_name =  "SR_LN(R0)",
+  run_num = c(6, 4,3,2),
+  data_file_nm = "base_model_data_file.dat")
+

where the run_num is the number reported in the +profile_SR_LN(RO))_results.csv file under the run column. Profiles are +run out from the base model parameter value to lower or higher values to +improve model convergence and hence, the run number reported in the csv +is not sequential from the lower to upper bounds.

+
+
+

Example: Run jitters in parrallel +

+

r4ss v1.49.3+ supports running models in parallel. This +can be particularly helpful when running jitters. In order to run +jitters in parallel, additional specifications are needed outside the +nwfscDiag package and some additional R packages +(parallelly, future) need to be installed:

+
ncores <- parallelly::availableCores(omit = 1)
+future::plan(future::multisession, workers = ncores)
+
+model_settings <- get_settings(settings = list(
+  exe = "ss3",
+  base_name = base_model,
+  run = "jitter",
+  Njitter = 100,
+  jitter_fraction = 0.10))
+
+run_diagnostics(mydir = dir, model_settings = model_settings)
+future::plan(future::sequential)
+

This same approach could be done with profiles, but is not +recommended for models with convergence issues.

+
+
+
+ + + +
+ + + +
+ +
+

+

Site built with pkgdown 2.1.1.

+
+ +
+
+ + + + + + + + diff --git a/authors.html b/authors.html new file mode 100644 index 0000000..31c5a04 --- /dev/null +++ b/authors.html @@ -0,0 +1,98 @@ + +Authors and Citation • nwfscDiag + + +
+
+ + + +
+
+
+ + + +
  • +

    Chantel Wetzel. Maintainer. +

    +
  • +
+
+
+

Citation

+ Source: DESCRIPTION +
+
+ + +

Wetzel C (2024). +nwfscDiag: Generate Standard NWFSC Assessment Diagnostics. +R package version 1.1.2, https://github.com/pfmc-assessments/nwfscDiag. +

+
@Manual{,
+  title = {nwfscDiag: Generate Standard NWFSC Assessment Diagnostics},
+  author = {Chantel Wetzel},
+  year = {2024},
+  note = {R package version 1.1.2},
+  url = {https://github.com/pfmc-assessments/nwfscDiag},
+}
+ +
+ +
+ + + +
+ +
+

Site built with pkgdown 2.1.1.

+
+ +
+ + + + + + + + diff --git a/bootstrap-toc.css b/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/bootstrap-toc.js b/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docsearch.css b/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docsearch.js b/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..224b042 --- /dev/null +++ b/index.html @@ -0,0 +1,162 @@ + + + + + + + +Generate Standard NWFSC Assessment Diagnostics • nwfscDiag + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + +
    + +

    The package provides the functionality to conduct model diagnostics for Stock Synthesis (SS3) models. The standard diagnostic included in this package are standard required analysis for U.S. West Coast Groundfish stock assessments managed by the Pacific Fisheries Management Council. The package was designed to perform model diagnostics and create plots and tables in a standardized format. The standardized approach will facilitate the use of these outputs in the assessment template approach sa4ss.

    +

    The diagnostics created by the package are: - jitter runs to ensure model convergence at the MLE, - retrospective runs to examine model sensitivity to recent data, and
    +- likelihood profiles across parameters.

    +

    This package does not maintain backward compatibility with previous versions of Stock Synthesis. However, if needed user can download older package versions that may work with older versions (3.30.+) of Stock Synthesis.

    +
    +

    Installation +

    +

    nwfscDiag can be installed via github:

    +
    install.packages("remotes")
    +remotes::install_github("pfmc-assessments/nwfscDiag")
    +
    +
    +

    Running the code +

    +

    The package depends upon a few other packages and they should be installed upon installation of the package. The dependent packages are:

    +
    install.packages('dplyr')
    +remotes::install_github('r4ss/r4ss')
    +

    A new version of r4ss package was released on July 29, 2022. This release included some significant changes that included changes to function names and function inputs. The current version of the nwfscDiag 1.1.2 package is designed to work with the latest release of r4ss. Please see release version 1.0.1 to use earlier versions of r4ss.

    +
    +
    +

    Reporting problems +

    +

    Please report any issues with this package by posting a new github issue at https://github.com/pfmc-assessments/nwfscDiag/issues.

    +
    +
    + +
    + + +
    + + +
    + +
    +

    +

    Site built with pkgdown 2.1.1.

    +
    + +
    +
    + + + + + + + + diff --git a/link.svg b/link.svg new file mode 100644 index 0000000..88ad827 --- /dev/null +++ b/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/pkgdown.css b/pkgdown.css new file mode 100644 index 0000000..80ea5b8 --- /dev/null +++ b/pkgdown.css @@ -0,0 +1,384 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body { + position: relative; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +/* Ensure in-page images don't run outside their container */ +.contents img { + max-width: 100%; + height: auto; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +dd { + margin-left: 3em; +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + display: none; + margin-left: 5px; + width: 20px; + height: 20px; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +h1:hover .anchor, +h2:hover .anchor, +h3:hover .anchor, +h4:hover .anchor, +h5:hover .anchor, +h6:hover .anchor { + display: inline-block; +} + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} + +/* Sidebar --------------------------*/ + +#pkgdown-sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} + +#pkgdown-sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#pkgdown-sidebar h2:first-child { + margin-top: 0; +} + +#pkgdown-sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + +.orcid { + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top; min-width: 100px} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre, code, pre code { + background-color: #f8f8f8; + color: #333; +} +pre, pre code { + white-space: pre-wrap; + word-break: break-all; + overflow-wrap: break-word; +} + +pre { + border: 1px solid #eee; +} + +pre .img, pre .r-plt { + margin: 5px 0; +} + +pre .img img, pre .r-plt img { + background-color: #fff; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.error {font-weight: bolder;} +.warning {font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} + +/* Section anchors --------------------------------- + Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 +*/ + +div.csl-bib-body { } +div.csl-entry { + clear: both; +} +.hanging-indent div.csl-entry { + margin-left:2em; + text-indent:-2em; +} +div.csl-left-margin { + min-width:2em; + float:left; +} +div.csl-right-inline { + margin-left:2em; + padding-left:1em; +} +div.csl-indent { + margin-left: 2em; +} diff --git a/pkgdown.js b/pkgdown.js new file mode 100644 index 0000000..6f0eee4 --- /dev/null +++ b/pkgdown.js @@ -0,0 +1,108 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $('.navbar-fixed-top').headroom(); + + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); + }); + + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $("div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/pkgdown.yml b/pkgdown.yml new file mode 100644 index 0000000..230ba21 --- /dev/null +++ b/pkgdown.yml @@ -0,0 +1,6 @@ +pandoc: 3.1.11 +pkgdown: 2.1.1 +pkgdown_sha: ~ +articles: + nwfscDiag: nwfscDiag.html +last_built: 2024-10-02T18:46Z diff --git a/reference/check_profile_range.html b/reference/check_profile_range.html new file mode 100644 index 0000000..1711ec6 --- /dev/null +++ b/reference/check_profile_range.html @@ -0,0 +1,108 @@ + +Check the profile range specified — check_profile_range • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Check the profile range specified

    +
    + +
    +
    check_profile_range(mydir, model_settings)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + +
    +
    +

    Value

    +

    Nothing is explicitly returned from check_profile_range()

    +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/get_jitter_quants.html b/reference/get_jitter_quants.html new file mode 100644 index 0000000..f42317f --- /dev/null +++ b/reference/get_jitter_quants.html @@ -0,0 +1,112 @@ + +Create output files with jitter quantities — get_jitter_quants • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Tables generated to visualize results

    +
    + +
    +
    get_jitter_quants(mydir, model_settings, output)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + + +
    output
    +

    List of model output created by run_jitter().

    + +
    +
    +

    Value

    +

    Nothing is explicitly returned from get_jitter_quants().

    +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/get_param_values.html b/reference/get_param_values.html new file mode 100644 index 0000000..c48de56 --- /dev/null +++ b/reference/get_param_values.html @@ -0,0 +1,116 @@ + +Generate likelihood profiles To be called from the run_diagnostics function after creating the model settings using the get_settings function. — get_param_values • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Generate likelihood profiles +To be called from the run_diagnostics function after creating +the model settings using the get_settings function.

    +
    + +
    +
    get_param_values(mydir, para = NULL, vec, summary)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    para
    +

    A character string specifying the SS3 parameter name that the +profile pertains to. The parameter name should match the name in the +control.ss_new file from SS3.

    + + +
    vec
    +

    Vector of parameter values or retrospective runs the summary object contains

    + + +
    summary
    +

    List created by the r4ss::SSsummarize() function

    + +
    +
    +

    Author

    +

    Chantel Wetzel & Kelli Johnson

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/get_retro_quants.html b/reference/get_retro_quants.html new file mode 100644 index 0000000..0b25315 --- /dev/null +++ b/reference/get_retro_quants.html @@ -0,0 +1,123 @@ + +Get model values across retrospective runs — get_retro_quants • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Get model values across retrospective runs

    +
    + +
    +
    get_retro_quants(mydir, model_settings, output)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + + +
    output
    +

    List of model output created by run_retro().

    + +
    +
    +

    Value

    +

    Nothing is explicitly returned from get_retro_quants(). +The following objects are saved to the disk.

    • mohnsrho.csv with the following columns:

      apply(utils::read.csv(file.path("..", paste0(mod_loc, "_retro"), "retrofigures4doc.csv")), 1, function(x) do.call(sa4ss::add_figure, as.list(x)))

    • +
    • mohnsrho.tex for use with sa4ss::read_child() +inside of an environment with results = "asis" +to include a table of Mohn's rho values in a document.

      +

      sa4ss::read_child(file.path(paste0(params[["model"]], "_retro"), "mohnsrho.tex"))

    • +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/get_settings.html b/reference/get_settings.html new file mode 100644 index 0000000..1a4735e --- /dev/null +++ b/reference/get_settings.html @@ -0,0 +1,227 @@ + +Check that all of the settings are in the list — get_settings • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Check that all of the settings are in the list

    +
    + +
    +
    get_settings(settings = NULL, verbose = FALSE)
    +
    + +
    +

    Arguments

    + + +
    settings
    +

    A list of the current settings where each object in the list +must be named. Those names that are not found in the stored list will be +added. The default value of NULL leads to a full list being +returned.

    + + +
    verbose
    +

    A logical value specifying if the message should be output to +the screen or not.

    + +
    +
    +

    Value

    +

    A list of settings for running model diagnostics.

    +
    +
    +

    Author

    +

    Chantel Wetzel & Kelli Faye Johnson

    +
    + +
    +

    Examples

    +
    get_settings(list("Njitter" = 10))
    +#> $Njitter
    +#> [1] 10
    +#> 
    +#> $base_name
    +#> [1] "model"
    +#> 
    +#> $para_offset
    +#> [1] FALSE
    +#> 
    +#> $run
    +#> [1] "jitter"  "profile" "retro"  
    +#> 
    +#> $profile_details
    +#>              parameters   low high step_size param_space
    +#> 1 NatM_uniform_Fem_GP_1  0.40  0.4      0.01  multiplier
    +#> 2           SR_BH_steep  0.25  1.0      0.05        real
    +#> 3             SR_LN(R0) -2.00  2.0      0.25    relative
    +#> 
    +#> $version
    +#> [1] "3.30"
    +#> 
    +#> $exe
    +#> [1] "ss3"
    +#> 
    +#> $verbose
    +#> [1] FALSE
    +#> 
    +#> $extras
    +#> [1] "-nohess"
    +#> 
    +#> $show_in_console
    +#> [1] TRUE
    +#> 
    +#> $printlikes
    +#> [1] FALSE
    +#> 
    +#> $jitter_fraction
    +#> [1] 0.05
    +#> 
    +#> $jitter_init_values_src
    +#> NULL
    +#> 
    +#> $oldsubdir
    +#> [1] ""
    +#> 
    +#> $newsubdir
    +#> [1] "retro"
    +#> 
    +#> $retro_yrs
    +#> [1] -1 -2 -3 -4 -5
    +#> 
    +#> $overwrite
    +#> [1] TRUE
    +#> 
    +#> $show_in_console
    +#> [1] FALSE
    +#> 
    +#> $btarg
    +#> NULL
    +#> 
    +#> $minbthresh
    +#> NULL
    +#> 
    +#> $remove_files
    +#> [1] TRUE
    +#> 
    +#> $oldctlfile
    +#> [1] "control.ss_new"
    +#> 
    +#> $newctlfile
    +#> [1] "control_modified.ss"
    +#> 
    +#> $linenum
    +#> NULL
    +#> 
    +#> $string
    +#> NULL
    +#> 
    +#> $profilevec
    +#> NULL
    +#> 
    +#> $usepar
    +#> [1] FALSE
    +#> 
    +#> $globalpar
    +#> [1] FALSE
    +#> 
    +#> $parlinenum
    +#> NULL
    +#> 
    +#> $parstring
    +#> NULL
    +#> 
    +#> $saveoutput
    +#> [1] TRUE
    +#> 
    +#> $overwrite
    +#> [1] TRUE
    +#> 
    +#> $whichruns
    +#> NULL
    +#> 
    +#> $prior_check
    +#> [1] FALSE
    +#> 
    +#> $read_like
    +#> [1] TRUE
    +#> 
    +#> $init_values_src
    +#> [1] 0
    +#> 
    +#> $subplots
    +#> [1] 1 3
    +#> 
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/get_settings_profile.html b/reference/get_settings_profile.html new file mode 100644 index 0000000..5bc378b --- /dev/null +++ b/reference/get_settings_profile.html @@ -0,0 +1,193 @@ + +Get default settings for profiles — get_settings_profile • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Create a data frame of parameters you want to profile over. The default +inputs for this function represent the typical parameters you would want +to profile over but the data frame can actually accommodate any viable +parameter in your Stock Synthesis model. Note that the defaults are, at a +minimum, the profiles needed in your assessment document if you are +presenting to the Pacific Fisheries Management Council.

    +
    + +
    +
    get_settings_profile(
    +  parameters = c("NatM_uniform_Fem_GP_1", "SR_BH_steep", "SR_LN(R0)"),
    +  low = c(0.4, 0.25, -2),
    +  high = c(0.4, 1, 2),
    +  step_size = c(0.01, 0.05, 0.25),
    +  param_space = c("multiplier", "real", "relative"),
    +  use_prior_like = lifecycle::deprecated()
    +)
    +
    + +
    +

    Arguments

    + + +
    parameters
    +

    A vector of character strings that specify the SS3 +parameter names that you want to conduct profiles for.

    + + +
    low, high
    +

    A numeric vector specifying the low or high parameter bounds +you want to use for the profile of each parameter in parameters.

    + + +
    step_size
    +

    A numeric vector specifying the increments between the low +and high bounds for each parameter in parameters. These values will be +passed to seq(from = low, to = high, by = step_size).

    + + +
    param_space
    +

    A vector of character strings that specify the way in +which you want the parameter bounds to be translated. The available options +are, "real", "mulitplier", and "relative".

    • "real" indicates bounds in the parameter space,

    • +
    • "relative" indicates how far to go from the base parameter, and

    • +
    • "multiplier" indicates that low and high bounds are set at x\ +and below the base parameter.

    • +
    + + +
    use_prior_like
    +

    Deprecated: The use_prior_like input is no longer +needed because r4ss now automatically plots the likelihood profile with and +without any parameter prior likelihood contributions regardless of the +setting in the user starter file.

    + +
    +
    +

    Value

    +

    A data frame with five columns,

    • parameters,

    • +
    • low,

    • +
    • high,

    • +
    • step_size, and

    • +
    • param_space. +Where, there is one row for each parameter that will be profiled. +The default settings provide users with a good template that they can add +to or modify by giving some reasonable inputs for the default parameters +that are requested in the Terms of Reference.

    • +
    +
    +

    Details

    +

    The param_space argument indicates where the range of of the profile +parameter should be interpreted as relative to the base model estimate vs. +across a pre-specified range. An example is for R0 where the default setting +below indicates that the param_space is relative where the low bound for the +profile is set = base model log(R0) - 2 and high = base model log(R0) + 2. +The default range for M is set as a multiplier to explore a range of (M - +0.40 * M) - (M + 0.40 * M) at a step size of 0.005. This range may be too +large (or small) with a step size too large (or too small) and should be +considered if the default settings are appropriate for your specific model. +The default setting for steepness is in 'real' space which means that the low +and high is in the same parameter space as the parameter. A user can select +any of the options for specifying a parameter range for any parameter.

    +
    +
    +

    Author

    +

    Chantel Wetzel & Kelli Johnson

    +
    + +
    +

    Examples

    +
    if (FALSE) { # \dontrun{
    +
    +# Define each parameter in real space
    +get_settings_profile(
    +  parameters = c("NatM_uniform_Fem_GP_1", "SR_BH_steep", "SR_LN(R0)"),
    +  low = c(0.02, 0.25, 8),
    +  high = c(0.07, 1.0, 11),
    +  step_size = c(0.005, 0.05, 0.25),
    +  param_space = c("real", "real", "real")
    +)
    +
    +# Example 2: Run a profile for natural mortality one with the prior likelihood and one without
    +get_settings_profile(
    +  parameters = c("NatM_uniform_Fem_GP_1", "NatM_uniform_Fem_GP_1"),
    +  low = c(0.40, 0.40),
    +  high = c(0.40, 0.40),
    +  step_size = c(0.005, 0.005),
    +  param_space = c("multiplier", "multiplier")
    +)
    +} # }
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/get_summary.html b/reference/get_summary.html new file mode 100644 index 0000000..5a1fdf9 --- /dev/null +++ b/reference/get_summary.html @@ -0,0 +1,117 @@ + +Generate results from likelihood profiles — get_summary • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Used by profile_wrapper() to write summary statistics to the disk.

    +
    + +
    +
    get_summary(mydir, para, vec, profilemodels, profilesummary)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    para
    +

    A character string specifying the SS3 parameter name that the +profile pertains to. The parameter name should match the name in the +control.ss_new file from SS3.

    + + +
    vec
    +

    A numeric vector specifying the parameter values that the +profile covers.

    + + +
    profilemodels
    +

    An object returned from r4ss::SSgetoutput().

    + + +
    profilesummary
    +

    An object returned from r4ss::SSsummarize().

    + +
    +
    +

    Author

    +

    Chantel Wetzel & Kelli Johnson

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/index.html b/reference/index.html new file mode 100644 index 0000000..ac8a109 --- /dev/null +++ b/reference/index.html @@ -0,0 +1,161 @@ + +Package index • nwfscDiag + + +
    +
    + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    All functions

    +

    +
    +

    check_profile_range()

    +

    Check the profile range specified

    +

    get_jitter_quants()

    +

    Create output files with jitter quantities

    +

    get_param_values()

    +

    Generate likelihood profiles To be called from the run_diagnostics function after creating the model settings using the get_settings function.

    +

    get_retro_quants()

    +

    Get model values across retrospective runs

    +

    get_settings()

    +

    Check that all of the settings are in the list

    +

    get_settings_profile()

    +

    Get default settings for profiles

    +

    get_summary()

    +

    Generate results from likelihood profiles

    +

    jitter_wrapper()

    +

    Run r4ss::jitter based on model_settings

    +

    plot_jitter()

    +

    Generated plots to visualize results

    +

    plot_profile()

    +

    Generate likelihood profile plots

    +

    plot_retro()

    +

    Create plots for retrospective runs

    +

    pngfun()

    +

    Create a .png figure

    +

    pretty_decimal()

    +

    Format a vector of real numbers with a pretty number of decimal places

    +

    profile_wrapper()

    +

    Run r4ss::profile() based on model_settings

    +

    rerun_profile_vals()

    +

    Rerun some of the models in a likelihood profile

    +

    retro_wrapper()

    +

    Run r4ss::retro based on model_settings

    +

    round_any()

    +

    Round values

    +

    run_diagnostics()

    +

    Wrapper to run each of the 3 standard diagnostic items:

    1. Jitter

    2. Profiles across requested SS3 parameters

    3. Retrospectives

    +

    run_jitter()

    +

    Run r4ss::jitter based on model_settings

    +

    run_profile()

    +

    Run r4ss::profile() based on model_settings

    +

    run_retro()

    +

    Run r4ss::retro based on model_settings

    + + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/jitter_wrapper.html b/reference/jitter_wrapper.html new file mode 100644 index 0000000..cfbac77 --- /dev/null +++ b/reference/jitter_wrapper.html @@ -0,0 +1,117 @@ + +Run r4ss::jitter based on model_settings — jitter_wrapper • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Code to run jitters for a model +Output will be saved in an Rdata object called "jitter_output" +Plots and tables generated to visualize results

    +
    + +
    +
    jitter_wrapper(mydir, model_settings)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + +
    +
    +

    Value

    +

    Nothing is explicitly returned from jitter_wrapper.

    +
    +
    +

    See also

    +

    The following functions interact with jitter_wrapper:

    +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/pipe.html b/reference/pipe.html new file mode 100644 index 0000000..79b7ba0 --- /dev/null +++ b/reference/pipe.html @@ -0,0 +1,99 @@ + +Pipe operator — %>% • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    See magrittr::%>% for details.

    +
    + +
    +
    lhs %>% rhs
    +
    + +
    +

    Arguments

    + + +
    lhs
    +

    A value or the magrittr placeholder.

    + + +
    rhs
    +

    A function call using the magrittr semantics.

    + +
    +
    +

    Value

    +

    The result of calling rhs(lhs).

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/plot_jitter.html b/reference/plot_jitter.html new file mode 100644 index 0000000..65b5ab1 --- /dev/null +++ b/reference/plot_jitter.html @@ -0,0 +1,112 @@ + +Generated plots to visualize results — plot_jitter • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Generated plots to visualize results

    +
    + +
    +
    plot_jitter(mydir, model_settings, output)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + + +
    output
    +

    List of model output created by run_jitter().

    + +
    +
    +

    Value

    +

    Nothing is explicitly returned from (plot_jitter[]).

    +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/plot_profile.html b/reference/plot_profile.html new file mode 100644 index 0000000..eec6872 --- /dev/null +++ b/reference/plot_profile.html @@ -0,0 +1,122 @@ + +Generate likelihood profile plots — plot_profile • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Create plots to be included in presentations and documents that +summarize a likelihood profile.

    +
    + +
    +
    plot_profile(mydir, rep, para, profilesummary)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    rep
    +

    A list of model output as returned by r4ss::SS_output().

    + + +
    para
    +

    A character string specifying the SS3 parameter name that the +profile pertains to. The parameter name should match the name in the +control.ss_new file from SS3. +The name will be cleaned up for plotting purposes internally within the function. +For example, SR_BH_steep becomes "Steepness (h)".

    + + +
    profilesummary
    +

    Output from r4ss::SSsummarize(). +Ensure that the results are ordered according to the parameter of interest. +Otherwise, the profile plots will not be smooth and lines will zig-zag back and forth.

    + +
    +
    +

    See also

    +

    profile_wrapper and rerun_profile_vals call plot_profile.

    +
    +
    +

    Author

    +

    Chantel Wetzel.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/plot_retro.html b/reference/plot_retro.html new file mode 100644 index 0000000..6e6f537 --- /dev/null +++ b/reference/plot_retro.html @@ -0,0 +1,116 @@ + +Create plots for retrospective runs — plot_retro • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Create plots for retrospective runs

    +
    + +
    +
    plot_retro(mydir, model_settings, output)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + + +
    output
    +

    List of model output created by run_retro().

    + +
    +
    +

    Value

    +

    Nothing is explicitly returned from plot_retro(). +The following objects are saved to the disk.

    • A set of figures from r4ss::SSplotComparisons

    • +
    • retrofigures4doc.csv for use with sa4ss::add_figure to add retro peels of +spawning stock biomass (SSB) and fraction unfished, +complete with captions and alternative text.

    • +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/pngfun.html b/reference/pngfun.html new file mode 100644 index 0000000..4de19ba --- /dev/null +++ b/reference/pngfun.html @@ -0,0 +1,109 @@ + +Create a .png figure — pngfun • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Create a .png figure

    +
    + +
    +
    pngfun(wd, file, w = 7, h = 7, pt = 12)
    +
    + +
    +

    Arguments

    + + +
    wd
    +

    A string providing the directory location where you want the +figure saved.

    + + +
    file
    +

    A string providing the name of the .png file that will be +saved in wd.

    + + +
    w, h
    +

    Numeric values providing the figure width and height in inches.

    + + +
    pt
    +

    Numeric value providing the point size.

    + +
    +
    +

    Author

    +

    by Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/pretty_decimal.html b/reference/pretty_decimal.html new file mode 100644 index 0000000..9f89f84 --- /dev/null +++ b/reference/pretty_decimal.html @@ -0,0 +1,120 @@ + +Format a vector of real numbers with a pretty number of decimal places — pretty_decimal • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Choose the final formatting for the number of decimals that should be +displayed given a vector of real numbers. All numbers in the returned +vector will be unique.

    +
    + +
    +
    pretty_decimal(x)
    +
    + +
    +

    Arguments

    + + +
    x
    +

    A vector of real numbers.

    + +
    +
    +

    Value

    +

    A vector of strings containing formatted numerical values all with +an equal number of decimal places and at least one decimal place.

    +
    +
    +

    Author

    +

    Kelli F. Johnson

    +
    + +
    +

    Examples

    +
    pretty_decimal(c(1.0, pi, 3.14, 0.002, 0.0021, 0.02))
    +#> [1] "1.0000" "3.1416" "3.1400" "0.0020" "0.0021" "0.0200"
    +
    +# Returns at least one decimal place even if not needed
    +pretty_decimal(1)
    +#> [1] "1.0"
    +
    +# Will return an error because duplicated entries
    +if (FALSE) { # \dontrun{
    +pretty_decimal(c(1.1, 1.1))
    +} # }
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/profile_wrapper.html b/reference/profile_wrapper.html new file mode 100644 index 0000000..4be1d43 --- /dev/null +++ b/reference/profile_wrapper.html @@ -0,0 +1,134 @@ + +Run r4ss::profile() based on model_settings — profile_wrapper • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Setting up the specifications, running the profile using r4ss::profile(), +and generating figures and tables can be tedious, error prone, and time +consuming. Thus, profile_wrapper() aims to further decrease the work +needed to generate a profile that is easily included in a assessment report +for the Pacific Fisheries Management Council. See the See Also section for +information on a workflow to use this function.

    +
    + +
    +
    profile_wrapper(mydir, model_settings)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + +
    +
    +

    Value

    +

    Nothing is explicitly returned from profile_wrapper(). +The following objects are saved to the disk:

    • *_profile_output.Rdata

    • +
    • *_trajectories_* from r4ss::SSplotComparisons()

    • +
    • piner_panel_*.png

    • +
    • parameter_panel_*.png

    • +
    • run_diag_warning.txt

    • +
    • a copy of the control file saved to model_settings$newctlfile

    • +
    • backup_oldctlfile.ss

    • +
    • backup_ss.par

    • +
    +
    +

    See also

    +

    The following functions interact with profile_wrapper():

    +
    +
    +

    Author

    +

    Chantel Wetzel and Ian Taylor.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/rerun_profile_vals.html b/reference/rerun_profile_vals.html new file mode 100644 index 0000000..df9f45e --- /dev/null +++ b/reference/rerun_profile_vals.html @@ -0,0 +1,172 @@ + +Rerun some of the models in a likelihood profile — rerun_profile_vals • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    To be called after run_diagnostics() in the instance when a model within a +profile has bad dynamics and could benefit from attempting the run with +different starting values. The jitter fraction will be turned on and the +model will be reran in hopes that a better likelihood can be found. The +summary diagnostics will be recreated as well.

    +
    + +
    +
    rerun_profile_vals(mydir, para_name, model_settings, run_num, data_file_nm)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    para_name
    +

    SS parameter name that the profile was run across. This is +used to located the correct folder combined with the mydir function input +(e.g., paste0(mydir, "/", model_settings[["base_name"]], "_profile_", para_name)).

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + + +
    run_num
    +

    An integer vector specifying the run numbers that you would +like to rerun for convergence. This input needs to match the run number for +the original profile (e.g., Report6.sso) that you would like to rerun.

    + + +
    data_file_nm
    +

    A character string specifying the name of the SS3 data +file. This is more than likely "data.ss".

    + +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    +

    Examples

    +
    if (FALSE) { # \dontrun{
    +model_settings <- get_settings()
    +temp_profile_dir <- file.path(tempdir(), "profile")
    +r4ss::copy_SS_inputs(
    +  recursive = TRUE,
    +  verbose = FALSE,
    +  dir.old = system.file(package = "r4ss", "extdata", "simple_small"),
    +  dir.new = file.path(temp_profile_dir, "simple_small"),
    +  overwrite = TRUE
    +)
    +ss3_path <- r4ss::get_ss3_exe(
    +  dir = file.path(temp_profile_dir, "simple_small")
    +)
    +model_settings <- get_settings(
    +  settings = list(
    +    base_name = "simple_small",
    +    exe = gsub("\\.exe", "", basename(ss3_path)),
    +    run = c("profile"),
    +    profile_details = get_settings_profile(
    +      parameters = c("NatM_uniform_Fem_GP_1"),
    +      low = c(0.20),
    +      high = c(0.25),
    +      step_size = c(0.02),
    +      param_space = c("multiplier")
    +    )
    +  )
    +)
    +run_diagnostics(
    +  mydir = temp_profile_dir,
    +  model_settings = model_settings
    +)
    +rerun_profile_vals(
    +  mydir = temp_profile_dir,
    +  model_settings = model_settings,
    +  para_name = "NatM_uniform_Fem_GP_1",
    +  run_num = c(1),
    +  data_file_nm = "data.ss"
    +)
    +} # }
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/retro_wrapper.html b/reference/retro_wrapper.html new file mode 100644 index 0000000..11b1e51 --- /dev/null +++ b/reference/retro_wrapper.html @@ -0,0 +1,135 @@ + +Run r4ss::retro based on model_settings — retro_wrapper • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Create a folder containing retrospective runs for a given base-model folder. +Runs are created using settings specified in model_settings and +is formatted for inclusion in a document.

    +
    + +
    +
    retro_wrapper(mydir, model_settings)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + +
    +
    +

    Value

    +

    Nothing is explicitly returned from retro_wrapper. +The following objects are saved to the disk.

    • mohnsrho.csv with the following columns:

    • +
    • A set of figures from r4ss::SSplotComparisons

    • +
    • retrofigures4doc.csv for use with sa4ss::add_figure to add retro peels of +spawning stock biomass (SSB) and fraction unfished, +complete with captions and alternative text.

      +

      apply(utils::read.csv(file.path("..", paste0(mod_loc, "_retro"), "retrofigures4doc.csv")), 1, function(x) do.call(sa4ss::add_figure, as.list(x)))

    • +
    • mohnsrho.tex for use with sa4ss::read_child() +inside of an environment with results = "asis" +to include a table of Mohn's rho values in a document.

      +

      sa4ss::read_child(file.path(paste0(params$model, "_retro"), "mohnsrho.tex"))

    • +
    • retro_output.Rdata with a list of R objects.

    • +
    +
    +

    See also

    +

    The following functions interact with retro_wrapper:

    +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/round_any.html b/reference/round_any.html new file mode 100644 index 0000000..023bed1 --- /dev/null +++ b/reference/round_any.html @@ -0,0 +1,99 @@ + +Round values — round_any • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Round values

    +
    + +
    +
    round_any(x, accuracy, f = round)
    +
    + +
    +

    Arguments

    + + +
    x
    +

    Numeric value to round.

    + + +
    accuracy
    +

    The number of digits to round to.

    + + +
    f
    +

    R function to apply. Default is round().

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/run_diagnostics.html b/reference/run_diagnostics.html new file mode 100644 index 0000000..75eb8fc --- /dev/null +++ b/reference/run_diagnostics.html @@ -0,0 +1,115 @@ + +Wrapper to run each of the 3 standard diagnostic items: Jitter Profiles across requested SS3 parameters Retrospectives — run_diagnostics • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Wrapper to run each of the 3 standard diagnostic items:

    1. Jitter

    2. +
    3. Profiles across requested SS3 parameters

    4. +
    5. Retrospectives

    6. +
    + +
    +
    run_diagnostics(mydir, model_settings)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + +
    +
    +

    Value

    +

    A vector of likelihoods for each jitter iteration.

    +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/run_jitter.html b/reference/run_jitter.html new file mode 100644 index 0000000..1c6ba6d --- /dev/null +++ b/reference/run_jitter.html @@ -0,0 +1,110 @@ + +Run r4ss::jitter based on model_settings — run_jitter • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Code to run jitters for a model +Output will be saved in an Rdata object called "jitter_output"

    +
    + +
    +
    run_jitter(mydir, model_settings)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + +
    +
    +

    Value

    +

    A list of quantities across jitters called jitter_output

    +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/run_profile.html b/reference/run_profile.html new file mode 100644 index 0000000..4acc333 --- /dev/null +++ b/reference/run_profile.html @@ -0,0 +1,140 @@ + +Run r4ss::profile() based on model_settings — run_profile • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Setting up the specifications, running the profile using r4ss::profile(), +and generating figures and tables can be tedious, error prone, and time +consuming. Thus, profile_wrapper() aims to further decrease the work +needed to generate a profile that is easily included in a assessment report +for the Pacific Fisheries Management Council. See the See Also section for +information on a workflow to use this function.

    +
    + +
    +
    run_profile(mydir, model_settings, para)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + + +
    para
    +

    A character string specifying the SS3 parameter name that the +profile pertains to. The parameter name should match the name in the +control.ss_new file from SS3.

    + +
    +
    +

    Value

    +

    Nothing is explicitly returned from profile_wrapper(). +The following objects are saved to the disk:

    • *_profile_output.Rdata

    • +
    • *_trajectories_* from r4ss::SSplotComparisons()

    • +
    • piner_panel_*.png

    • +
    • parameter_panel_*.png

    • +
    • run_diag_warning.txt

    • +
    • a copy of the control file saved to model_settings$newctlfile

    • +
    • backup_oldctlfile.ss

    • +
    • backup_ss.par

    • +
    +
    +

    See also

    +

    The following functions interact with profile_wrapper():

    +
    +
    +

    Author

    +

    Chantel Wetzel and Ian Taylor.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/reference/run_retro.html b/reference/run_retro.html new file mode 100644 index 0000000..92977b1 --- /dev/null +++ b/reference/run_retro.html @@ -0,0 +1,135 @@ + +Run r4ss::retro based on model_settings — run_retro • nwfscDiag + + +
    +
    + + + +
    +
    + + +
    +

    Create a folder containing retrospective runs for a given base-model folder. +Runs are created using settings specified in model_settings and +is formatted for inclusion in a document.

    +
    + +
    +
    run_retro(mydir, model_settings)
    +
    + +
    +

    Arguments

    + + +
    mydir
    +

    Directory where model files are located. +There is no default entry for mydir. +An example of user input could be +mydir = file.path("C:/my_models", "base_model").

    + + +
    model_settings
    +

    A list of all model settings. +Typically, created using get_settings but users can create their own list, +as long as it has all of the necessary components for the function at hand.

    + +
    +
    +

    Value

    +

    Nothing is explicitly returned from retro_wrapper. +The following objects are saved to the disk.

    • mohnsrho.csv with the following columns:

    • +
    • A set of figures from r4ss::SSplotComparisons

    • +
    • retrofigures4doc.csv for use with sa4ss::add_figure to add retro peels of +spawning stock biomass (SSB) and fraction unfished, +complete with captions and alternative text.

      +

      apply(utils::read.csv(file.path("..", paste0(mod_loc, "_retro"), "retrofigures4doc.csv")), 1, function(x) do.call(sa4ss::add_figure, as.list(x)))

    • +
    • mohnsrho.tex for use with sa4ss::read_child() +inside of an environment with results = "asis" +to include a table of Mohn's rho values in a document.

      +

      sa4ss::read_child(file.path(paste0(params[["model"]], "_retro"), "mohnsrho.tex"))

    • +
    • retro_output.Rdata with a list of R objects.

    • +
    +
    +

    See also

    +

    The following functions interact with retro_wrapper:

    +
    +
    +

    Author

    +

    Chantel Wetzel

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.1.1.

    +
    + +
    + + + + + + + + diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..c29e0ad --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,31 @@ + +/404.html +/articles/index.html +/articles/nwfscDiag.html +/authors.html +/index.html +/reference/check_profile_range.html +/reference/get_jitter_quants.html +/reference/get_param_values.html +/reference/get_retro_quants.html +/reference/get_settings.html +/reference/get_settings_profile.html +/reference/get_summary.html +/reference/index.html +/reference/jitter_wrapper.html +/reference/pipe.html +/reference/plot_jitter.html +/reference/plot_profile.html +/reference/plot_retro.html +/reference/pngfun.html +/reference/pretty_decimal.html +/reference/profile_wrapper.html +/reference/rerun_profile_vals.html +/reference/retro_wrapper.html +/reference/round_any.html +/reference/run_diagnostics.html +/reference/run_jitter.html +/reference/run_profile.html +/reference/run_retro.html + +