Title: | Stock Synthesis Model Diagnostics for Intergated Stock Assessments |
---|---|
Description: | Compilation of diagnostic functions for Stock Synthesis models, which developed for the manuscript "Using Model Diagnostics in Integrated Stock Assessments". |
Authors: | Henning Winker [aut], Felipe Carvalho [aut], Massimiliano Cardinale [aut], Laurence Kell [aut], Megumi Oshima [aut, cre], Eric Fletcher [aut] |
Maintainer: | Megumi Oshima <[email protected]> |
License: | EUPL |
Version: | 2.2.1 |
Built: | 2024-11-20 03:39:14 UTC |
Source: | https://github.com/PIFSCstockassessments/ss3diags |
TA1.8 Francis function modified from r4ss::SSMethod.TA1.8 and r4ss::SSMethod.Cond.TA1.8 apply Francis weighting method TA1.8 to length-, age-, generalized size-composition data, or conditional age-at-length data from a Stock Synthesis model. For conditional age-at-length data, the mean age by year is calculated based on recommendations by Punt (2015). The main purpose is to create a dataframe of the annual observed and expected mean length or age for each fleet that is used to calculate residuals for testing model fit. This function is used in SSplotRunstest and SSplotJABBAres.
SScompsTA1.8( ss3rep, type = c("len", "age", "size", "con"), fleet = NULL, seas = NULL, plotit = FALSE, maxpanel = 1000 )
SScompsTA1.8( ss3rep, type = c("len", "age", "size", "con"), fleet = NULL, seas = NULL, plotit = FALSE, maxpanel = 1000 )
ss3rep |
Stock Synthesis output as read by r4SS function SS_output |
type |
string of either 'len' (for length composition data), 'size' (for generalized size composition data), 'age' (for age composition data), or 'con' (for conditional age at length data) |
fleet |
vector of one or more fleet numbers whose data are to be analysed simultaneously, if NULL, all fleets will be analysed |
seas |
string indicating how to treat data from multiple seasons 'comb' - combine seasonal data for each year and plot against Yr 'sep' - treat season separately, plotting against Yr.S. If is.null(seas), it is assumed that there is only one season and option 'comb' is used. |
plotit |
if TRUE, make an illustrative plot like one or more panels of Fig. 4 in Francis (2011). |
maxpanel |
maximum number of panels within a plot, default 1000 |
ss_out data.frame of observed, predicted mean length/age and 95% confidence intervals based on stage 1 and stage 2 weighting
runs_dat data.frame of observed and predicted mean length or age for each year/fleet.
Chris Francis, Andre Punt, Ian Taylor (modified by Henning Winker and Meg Oshima)
Francis, R.I.C.C. (2011). Data weighting in statistical fisheries stock assessment models. Canadian Journal of Fisheries and Aquatic Sciences 68: 1124-1138.
#' Punt, A.E. (2015). Some insights into data weighting in integrated stock assessments. Fish. Res. <http://dx.doi.org/10.1016/j.fishres.2015.12.006
A function to generate joint distributions for stock status ratios (SSB/SSBref and F/Fref where ref can be MSY, SSB40, F40, etc.) using a Multivariate Log-Normal Distribution. The function produces a Kobe plot, maximum likelihood estimates and the MVLN Monte-Carlo distributions of the Kobe values which can be input into SSplotEnsemble().
SSdeltaMVLN( ss3rep, Fref = NULL, years = NULL, mc = 5000, weight = 1, run = "MVLN", plot = TRUE, addprj = FALSE, ymax = NULL, xmax = NULL, legendcex = 1, verbose = TRUE, variance_method = "ww2019", bias_correct_mean = FALSE )
SSdeltaMVLN( ss3rep, Fref = NULL, years = NULL, mc = 5000, weight = 1, run = "MVLN", plot = TRUE, addprj = FALSE, ymax = NULL, xmax = NULL, legendcex = 1, verbose = TRUE, variance_method = "ww2019", bias_correct_mean = FALSE )
ss3rep |
from r4ss::SS_output |
Fref |
Choice of Fratio c("MSY","Btgt"), correponding to F_MSY and F_Btgt |
years |
single year or vector of years for mvln |
mc |
number of monte-carlo simulations |
weight |
weighting option for model ensembles weight*mc |
run |
qualifier for model run |
plot |
option to show plot |
addprj |
include forecast years |
ymax |
ylim maximum |
xmax |
xlim maximum |
legendcex |
Allows to adjust legend cex |
verbose |
Report progress to R GUI? |
variance_method |
Specify method for approximating the variance and covariance of the multivariate lognormal distribution
|
bias_correct_mean |
Specify if the Stock Synthesis MLE estimates should be bias corrected when used to specify the mean of the multivariate lognormal distribution
|
output list of maximum likelihood estimates and the MVLN Monte-Carlo distributions of the Kobe values, and kobe plot
Henning Winker (JRC-EC)
Nicholas Ducharme-Barth (PIFSC)
A function to generate kobe pdfs from a Multivariate Log-Normal Distribution including plotting option. This version is used for older versions of Stock Synthesis. For newer versions (v3.24 and newer), use SSdeltaMVLN().
SSdeltaMVLN_old( ss3rep, status = c("Bratio", "F"), quants = c("SSB", "Recr"), Fref = c("MSY", "Ftrg"), years = NULL, mc = 5000, weight = 1, run = "MVLN", plot = TRUE, addtrj = TRUE, ymax = NULL, xmax = NULL, legendcex = 1, verbose = TRUE )
SSdeltaMVLN_old( ss3rep, status = c("Bratio", "F"), quants = c("SSB", "Recr"), Fref = c("MSY", "Ftrg"), years = NULL, mc = 5000, weight = 1, run = "MVLN", plot = TRUE, addtrj = TRUE, ymax = NULL, xmax = NULL, legendcex = 1, verbose = TRUE )
ss3rep |
from r4ss::SSgetoutput()["replist1"] |
status |
covarying stock status quantaties to extract from Hessian |
quants |
additional stock quantaties to extract from Hessian |
Fref |
Choice of reference point for stock SSB/XFref=c("MSY","Ftrg"),only if F_report_basis: 0 or 3 |
years |
single year or vector of years for mvln |
mc |
number of monte-carlo simulations |
weight |
weighting option for model ensembles weight*mc |
run |
qualifier for model run |
plot |
option to show plot |
addtrj |
TRUE/FALSE add trajectory of years. Default is TRUE |
ymax |
ylim maximum |
xmax |
xlim maximum |
legendcex |
Allows to adjust legend cex |
verbose |
Report progress to R GUI? |
output list of kobe objects and mle's
Henning Winker (JRC-EC)
A function to generate joint distributions for stock status ratios (SSB/SSBref and F/Fref where ref can be MSY, SSB40, F40, etc.) using MCMC. The function produces a Kobe plot, maximum likelihood estimates and the MVLN Monte-Carlo distributions of the Kobe values which can be input into SSplotEnsemble().
SSdiagsMCMC( mcmc, ss3rep, Fref = NULL, years = NULL, run = "MCMC", thin = 1, plot = TRUE, addprj = FALSE, ymax = NULL, xmax = NULL, legendcex = 1, verbose = TRUE )
SSdiagsMCMC( mcmc, ss3rep, Fref = NULL, years = NULL, run = "MCMC", thin = 1, plot = TRUE, addprj = FALSE, ymax = NULL, xmax = NULL, legendcex = 1, verbose = TRUE )
mcmc |
file path for folder with the derived_posteriors.sso file |
ss3rep |
from r4ss::SS_output |
Fref |
Choice of Fratio c("MSY","Btgt), correponding to F_MSY and F_Btgt |
years |
single year or vector of years for mvln |
run |
qualifier for model run |
thin |
option to use additional thinning |
plot |
option to show plot |
addprj |
include forecast years |
ymax |
ylim maximum |
xmax |
xlim maximum |
legendcex |
Allows to adjust legend cex |
verbose |
Report progress to R GUI? |
output list maximum likelihood estimates and the MCMC posterier distributions of the Kobe values and a Kobe plot
Henning Winker (JRC-EC), Massimiliano and Laurence Kell (Sea++)
SSdeltaMVLN()
, SSplotEnsemble()
, SSplotKobe()
A function to generate joint distributions for stock status ratios (SSB/SSBref and F/Fref where ref can be MSY, SSB40, F40, etc.) using MCMC. The function produces a Kobe plot, maximum likelihood estimates and the MVLN Monte-Carlo distributions of the Kobe values which can be input into SSplotEnsemble(). Use for Stock Synthesis models older than 3.24, for later versions use SSdiagsMCMC().
SSdiagsMCMC_ancient( mcmc, ss3rep, Fref = NULL, years = NULL, run = "MCMC", thin = 1, plot = TRUE, addprj = FALSE, ymax = NULL, xmax = NULL, legendcex = 1, verbose = TRUE )
SSdiagsMCMC_ancient( mcmc, ss3rep, Fref = NULL, years = NULL, run = "MCMC", thin = 1, plot = TRUE, addprj = FALSE, ymax = NULL, xmax = NULL, legendcex = 1, verbose = TRUE )
mcmc |
file path for folder with the derived_posteriors.sso file |
ss3rep |
from r4ss::SS_output |
Fref |
Choice of Fratio c("MSY","Btgt), correponding to F_MSY and F_Btgt |
years |
single year or vector of years for mvln |
run |
qualifier for model run |
thin |
option to use additional thinning |
plot |
option to show plot |
addprj |
include forecast years |
ymax |
ylim maximum |
xmax |
xlim maximum |
legendcex |
Allows to adjust legend cex |
verbose |
Report progress to R GUI? |
output list maximum likelihood estimates and the MCMC posterier distributions of the Kobe values and a Kobe plot
Henning Winker (JRC-EC), Massimiliano and Laurence Kell (Sea++)
This function produces the statistics from retrospective analysis (Mohn's rho and forecast bias). To visualize the retrospective forecasts from a Stock Synthesis model, use SSplotRetro().
SShcbias( summaryoutput, quants = c("SSB", "F"), models = "all", endyrvec = "default", verbose = TRUE )
SShcbias( summaryoutput, quants = c("SSB", "F"), models = "all", endyrvec = "default", verbose = TRUE )
summaryoutput |
List created by r4ss::SSsummarize() |
quants |
SSB or F quantity |
models |
Optional subset of the models described in r4ss function summaryoutput(). Either "all" or a vector of numbers indicating columns in summary tables. |
endyrvec |
Optional single year or vector of years representing the final year of values to show for each model. By default it is set to the ending year specified in each model. |
verbose |
Report progress to R GUI? |
Henning Winker (JRC-EC) and Laurance Kell (Sea++)
MASE for one-step ahead hindcasting cross-validations and computes MASE from prediction residuals of indices. MASE is calculated the average ratio of mean absolute error (MAE) of prediction residuals (MAE.PR) and Naive Predictions (MAE.base) MASE.adj sets the MAE.base to a minimum MAE.base.adj (default=0.1) MASE.adj allow passing (MASE<1) if MAE.PE < 0.1 and thus accurate, when obs show extremely little variation
SSmase( retroSummary, quants = c("cpue", "len", "age", "con"), Season = "default", models = "all", endyrvec = "default", indexselect = NULL, MAE.base.adj = 0.1, residuals = FALSE, verbose = FALSE, indexfleets = 1 )
SSmase( retroSummary, quants = c("cpue", "len", "age", "con"), Season = "default", models = "all", endyrvec = "default", indexselect = NULL, MAE.base.adj = 0.1, residuals = FALSE, verbose = FALSE, indexfleets = 1 )
retroSummary |
raw list of retrospective runs created by |
quants |
data type, either "cpue" for index data, "len" for length composition data, or "age" for age composition data. Note, if using "age" or "len", SSretroComps() will be used to extract and summarize the composition data first. |
Season |
option to specify Season as an integer of value 1-4 - Default uses first available, i.e. usual Seas = 1 |
models |
Optional subset of the models described in r4ss function summaryoutput(). Either "all" or a vector of numbers indicating columns in summary tables. |
endyrvec |
Optional single year or vector of years representing the final year of values to show for each model. By default it is set to the ending year specified in each model. |
indexselect |
Vector of fleet numbers for each model for which to compare |
MAE.base.adj |
minimum MASE demoninator (naive predictions) for MASE.adj (default = 0.1) |
residuals |
If true, includes a dataframe in the output of the prediction residuals and naive prediction residuals. Default is FALSE. |
verbose |
Report progress to R GUI? |
indexfleets |
Single value or vector of length n = number of models in summary object of the fleet number(s) for the index to compare. |
MASE and hcxval statistic
Henning Winker (JRC-EC) and Laurence Kell (Sea++)
SSretroComps()
r4ss::SSsummarize()
## Not run: # calculate MASE for CPUE indices only for fleets 1 and 2 SSmase(retro.sma, quant = "cpue", indexselect = c(1:2)) ## End(Not run)
## Not run: # calculate MASE for CPUE indices only for fleets 1 and 2 SSmase(retro.sma, quant = "cpue", indexselect = c(1:2)) ## End(Not run)
Plots model ensembles and forecasts with uncertainty represented by MVLN or MCMC posteriors
SSplotEnsemble( kb, subplots = c("stock", "harvest", "SSB", "F", "Recr", "Catch"), models = "all", quantiles = list(c(0.025, 0.975)), ylabs = NULL, endyrvec = "default", plot = TRUE, print = deprecated(), print_plot = FALSE, png = deprecated(), use_png = print_plot, pdf = FALSE, use_pdf = FALSE, col = NULL, pch = NULL, lty = 1, lwd = 2, tickEndYr = FALSE, xlim = NULL, ylimAdj = 1.05, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "l", uncertainty = TRUE, legend = TRUE, legendlabels = "default", legendloc = "topright", legendorder = "default", legendncol = 1, legendcex = 1, legendsp = 0.9, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, shadealpha = 0.3, new = TRUE, add = FALSE, mcmcVec = FALSE, indexQlabel = TRUE, indexQdigits = 4, legendindex = NULL )
SSplotEnsemble( kb, subplots = c("stock", "harvest", "SSB", "F", "Recr", "Catch"), models = "all", quantiles = list(c(0.025, 0.975)), ylabs = NULL, endyrvec = "default", plot = TRUE, print = deprecated(), print_plot = FALSE, png = deprecated(), use_png = print_plot, pdf = FALSE, use_pdf = FALSE, col = NULL, pch = NULL, lty = 1, lwd = 2, tickEndYr = FALSE, xlim = NULL, ylimAdj = 1.05, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "l", uncertainty = TRUE, legend = TRUE, legendlabels = "default", legendloc = "topright", legendorder = "default", legendncol = 1, legendcex = 1, legendsp = 0.9, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, shadealpha = 0.3, new = TRUE, add = FALSE, mcmcVec = FALSE, indexQlabel = TRUE, indexQdigits = 4, legendindex = NULL )
kb |
|
subplots |
vector to create subplots with these options:
|
models |
option to manually subset the models in |
quantiles |
quantiles for uncertainty in plots. Input as a list,
default is the 95TH percentile: |
ylabs |
y-axis labels for quants |
endyrvec |
Optional single year or vector of years representing the
final year of values to show for each model. By |
plot |
DEPRECATED. By default, TRUE, Plots (and subplots) are drawn to the plot device. The option to explicitly disable this option (FALSE), is not implemented. This option flag will be defunct in a future version |
print |
DEPRECATED, please use |
print_plot |
Flag to enable plot graphic device to print to PNG or PNG files. |
png |
DEPRECATED. Please use |
use_png |
Enables plots to be generated to PNG files. Defaults to print value |
pdf |
DEPRECATED. Please use |
use_pdf |
Enables plots to be generated to pdf file. |
col |
Optional vector of colors to be used for lines. Input NULL |
pch |
Optional vector of plot character values |
lty |
Optional vector of line types |
lwd |
Optional vector of line widths |
tickEndYr |
Logical flag: set TRUE or FALSE to switch to turn on/off extra axis mark at final year in timeseries plots. |
xlim |
Optional, years to use for x-axis. Default value NULL (or "default"), uses all years available. |
ylimAdj |
Multiplier for ylim parameter. Allows additional white space. |
xaxs |
Choice of xaxs parameter See |
yaxs |
Choice of yaxs parameter. See |
xylabs |
Logical flag: set TRUE or FALSE to include x- and y-axis labels to the plot. Defaults to TRUE |
type |
The type of plot to be drawn. For more details, see |
uncertainty |
Logical flag to enable plots with uncertainty intervals. Either a single TRUE/FALSE value, or a vector of TRUE/FALSE values around SSB or F estimated timeseries, or a set of integers corresponding to the choice of models. |
legend |
Flag to enable legend to plot. TRUE by default. |
legendlabels |
Optional vector of labels to include in legend. |
legendloc |
Location of legend. Either a string like "topleft" or a vector of two
numeric values representing the fraction of the maximum in the x and y
dimensions, respectively. See |
legendorder |
Optional vector of model numbers that can be used to have the legend display the model names in an order that is different than that which is represented in the summary input object. |
legendncol |
Number of columns for the legend. |
legendcex |
Allows to adjust legend cex |
legendsp |
Space between legend labels |
pwidth |
Default width of plot printed to plot in units of |
pheight |
Height of plot printed to plot in units of |
punits |
Measurement units for
|
res |
Resolution for plots printed to files. |
ptsize |
Point size for plotted text in plots printed in files. See |
cex.main |
Character expansion for plot titles. |
plotdir |
Directory where output plot file will be written. By default, it will be the directory where the model was run. |
filenameprefix |
Additional text to append to output plot file name. It will be separated from default name by an underscore. |
par |
A numerical vector of the form c(bottom, left, top, right) which
gives the number of lines of margin to be specified on the four sides of
the plot,which is passed to |
verbose |
Flag to print additional diagnostic messages to R console |
shadealpha |
Transparency adjustment used to make uncertainty regions, default is 0.3 |
new |
Deprecated. New plot windows are created by default (TRUE), and the option to disable this, via FALSE, is unused. |
add |
suppresses |
mcmcVec |
Logical vector of TRUE/FALSE values (or single value) indicating whether input values are from MCMC or to use normal distribution around MLE. |
indexQlabel |
TRUE/FALSE include labels for indices. Default is TRUE (currently not used) |
indexQdigits |
Number of significant digits for catchability in legend. Default is 4 |
legendindex |
Allows to add legend for selected indices (plots) |
Mostly adopted from r4ss::SSplotComparisons by Taylor et al
## Not run: mvln <- SSdeltaMVLN(simple, run = "Simple") sspar(mfrow = c(3, 2), plot.cex = 0.7) SSplotEnsemble(mvln[["kb"]], ylabs = mvln[["labels"]], add = T, verbose = F) ## End(Not run)
## Not run: mvln <- SSdeltaMVLN(simple, run = "Simple") sspar(mfrow = c(3, 2), plot.cex = 0.7) SSplotEnsemble(mvln[["kb"]], ylabs = mvln[["labels"]], add = T, verbose = F) ## End(Not run)
Plots one-step ahead hindcasting cross-validations and computes MASE from
prediction residuals.MASE
is calculated as the average ratio of mean
absolute error (MAE
) of prediction residuals (MAE.PR
) and naive
predictions (MAE.base
). MASE.adj
sets the MAE.base
to a minimum
MAE.base.adj
(default=0.1
). MASE.adj
allow passing (MASE<1
) if
MAE.PE < 0.1
and thus accurate if obs show very little annual variation
SSplotHCxval( retroSummary, subplots = c("cpue", "len", "age"), Season = "default", print = deprecated(), print_plot = FALSE, png = deprecated(), use_png = print_plot, pdf = deprecated(), use_pdf = FALSE, models = "all", endyrvec = "default", xmin = NULL, indexselect = NULL, MAE.base.adj = 0.1, show.mase.adj = TRUE, indexUncertainty = TRUE, col = NULL, pch = NULL, lty = 1, lwd = 2, tickEndYr = TRUE, xlim = "default", ylimAdj = 1.15, ylim = NULL, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "o", uncertainty = TRUE, legend = TRUE, legendlabels = "default", legendloc = "topright", legendorder = "default", legendncol = 1, legendcex = 1, legendsp = 0.9, legendindex = NULL, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, shadecol = grey(0.5, 0.4), shadecol2 = grey(0.5, 0.4), shadealpha = 0.3, new = TRUE, add = FALSE, mcmcVec = FALSE, indexQlabel = TRUE, indexQdigits = 4, indexfleets = 1, plot = TRUE, shadecol1 = grey(0.5, 0.4) )
SSplotHCxval( retroSummary, subplots = c("cpue", "len", "age"), Season = "default", print = deprecated(), print_plot = FALSE, png = deprecated(), use_png = print_plot, pdf = deprecated(), use_pdf = FALSE, models = "all", endyrvec = "default", xmin = NULL, indexselect = NULL, MAE.base.adj = 0.1, show.mase.adj = TRUE, indexUncertainty = TRUE, col = NULL, pch = NULL, lty = 1, lwd = 2, tickEndYr = TRUE, xlim = "default", ylimAdj = 1.15, ylim = NULL, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "o", uncertainty = TRUE, legend = TRUE, legendlabels = "default", legendloc = "topright", legendorder = "default", legendncol = 1, legendcex = 1, legendsp = 0.9, legendindex = NULL, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, shadecol = grey(0.5, 0.4), shadecol2 = grey(0.5, 0.4), shadealpha = 0.3, new = TRUE, add = FALSE, mcmcVec = FALSE, indexQlabel = TRUE, indexQdigits = 4, indexfleets = 1, plot = TRUE, shadecol1 = grey(0.5, 0.4) )
retroSummary |
List created by |
subplots |
optional use of the following:
|
Season |
option to specify Season as an integer of value 1-4. Default uses first available, i.e. usual Seas = 1 |
print |
DEPRECATED, please use |
print_plot |
Flag to enable plot graphic device to print to PNG or PNG files. |
png |
DEPRECATED. Please use |
use_png |
Enables plots to be generated to PNG files. Defaults to print value |
pdf |
DEPRECATED. Please use |
use_pdf |
Enables plots to be generated to pdf file. |
models |
Optional subset of the models of |
endyrvec |
Optional single year or vector of years representing the final year of values to show for each model. By default it is set to the ending year specified in each model. |
xmin |
optional number first year shown in plot (if available) |
indexselect |
Vector of fleet numbers for each model for which to compare |
MAE.base.adj |
minimum |
show.mase.adj |
if TRUE, it show |
indexUncertainty |
Show fixed uncertainty intervals on index (not estimated) |
col |
Optional vector of colors to be used for lines. Input NULL |
pch |
Optional vector of plot character values |
lty |
Optional vector of line types |
lwd |
Optional vector of line widths |
tickEndYr |
Logical flag: set TRUE or FALSE to switch to turn on/off extra axis mark at final year in timeseries plots. |
xlim |
Optional, years to use for x-axis. Default value NULL (or "default"), uses all years available. |
ylimAdj |
Multiplier for ylim parameter. Allows additional white space. |
ylim |
will over-write |
xaxs |
Choice of xaxs parameter See |
yaxs |
Choice of yaxs parameter. See |
xylabs |
Logical flag: set TRUE or FALSE to include x- and y-axis labels to the plot. Defaults to TRUE |
type |
The type of plot to be drawn. For more details, see |
uncertainty |
Logical flag to enable plots with uncertainty intervals. Either a single TRUE/FALSE value, or a vector of TRUE/FALSE values around SSB or F estimated timeseries, or a set of integers corresponding to the choice of models. |
legend |
Flag to enable legend to plot. TRUE by default. |
legendlabels |
Optional vector of labels to include in legend. |
legendloc |
Location of legend. Either a string like "topleft" or a vector of two
numeric values representing the fraction of the maximum in the x and y
dimensions, respectively. See |
legendorder |
Optional vector of model numbers that can be used to have the legend display the model names in an order that is different than that which is represented in the summary input object. |
legendncol |
Number of columns for the legend. |
legendcex |
Allows to adjust legend cex |
legendsp |
Space between legend labels |
legendindex |
Allows to add legend for selected indices (plots) |
pwidth |
Default width of plot printed to plot in units of |
pheight |
Height of plot printed to plot in units of |
punits |
Measurement units for
|
res |
Resolution for plots printed to files. |
ptsize |
Point size for plotted text in plots printed in files. See |
cex.main |
Character expansion for plot titles. |
plotdir |
Directory where output plot file will be written. By default, it will be the directory where the model was run. |
filenameprefix |
Additional text to append to output plot file name. It will be separated from default name by an underscore. |
par |
A numerical vector of the form c(bottom, left, top, right) which
gives the number of lines of margin to be specified on the four sides of
the plot,which is passed to |
verbose |
Flag to print additional diagnostic messages to R console |
shadecol |
uncertainty shading of hcxval horizon |
shadecol2 |
color for uncertainty in early years not affected by hindcast |
shadealpha |
Transparency adjustment used to make default |
new |
Deprecated. New plot windows are created by default (TRUE), and the option to disable this, via FALSE, is unused. |
add |
suppresses |
mcmcVec |
Logical vector of TRUE/FALSE values (or single value) indicating whether input values are from MCMC or to use normal distribution around MLE. |
indexQlabel |
Logical flag to add catchability to legend in plot of index fits. |
indexQdigits |
Number of significant digits for catchability in legend |
indexfleets |
Fleet numbers for each model to compare indices of abundance. Can take different forms:
|
plot |
DEPRECATED. By default, TRUE, Plots (and subplots) are drawn to the plot device. The option to explicitly disable this option (FALSE), is not implemented. This option flag will be defunct in a future version |
shadecol1 |
uncertainty shading of early years not affected by hindcast (currently not used) |
Henning Winker (JRC-EC) and Laurence Kell (Sea++)
Plots residuals for all indices as boxplot (color coded by fleet) with a loess showing systematic trends over time. This function is from the package JABBA (Just Another Bayesian Biomass Assessment).
SSplotJABBAres( ss3rep, subplots = c("cpue", "len", "age", "size", "con")[1], seas = NULL, plot = TRUE, print = lifecycle::deprecated(), print_plot = FALSE, png = lifecycle::deprecated(), use_png = print_plot, pdf = lifecycle::deprecated(), use_pdf = FALSE, indexselect = NULL, miny = 3, col = NULL, pch = 21, lty = 1, lwd = 2, tickEndYr = TRUE, xlim = "default", ylim = "default", ylimAdj = 1.1, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "o", legend = TRUE, legendlabels = "default", legendloc = "bottomleft", legendorder = "default", legendncol = 1, legendcex = 1, legendsp = 0.9, legendindex = NULL, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, boxcol = grey(0.8, 0.5), new = TRUE, add = FALSE )
SSplotJABBAres( ss3rep, subplots = c("cpue", "len", "age", "size", "con")[1], seas = NULL, plot = TRUE, print = lifecycle::deprecated(), print_plot = FALSE, png = lifecycle::deprecated(), use_png = print_plot, pdf = lifecycle::deprecated(), use_pdf = FALSE, indexselect = NULL, miny = 3, col = NULL, pch = 21, lty = 1, lwd = 2, tickEndYr = TRUE, xlim = "default", ylim = "default", ylimAdj = 1.1, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "o", legend = TRUE, legendlabels = "default", legendloc = "bottomleft", legendorder = "default", legendncol = 1, legendcex = 1, legendsp = 0.9, legendindex = NULL, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, boxcol = grey(0.8, 0.5), new = TRUE, add = FALSE )
ss3rep |
Stock Synthesis output as read by |
subplots |
string of type of data to plot:
|
seas |
string indicating how to treat data from multiple seasons:
|
plot |
DEPRECATED. By default, TRUE, Plots (and subplots) are drawn to the plot device. The option to explicitly disable this option (FALSE), is not implemented. This option flag will be defunct in a future version |
print |
DEPRECATED, please use |
print_plot |
Flag to enable plot graphic device to print to PNG or PNG files. |
png |
DEPRECATED. Please use |
use_png |
Enables plots to be generated to PNG files. Defaults to print value |
pdf |
DEPRECATED. Please use |
use_pdf |
Enables plots to be generated to pdf file. |
indexselect |
Vector of fleet numbers for each model for which to compare |
miny |
minimum abs values of |
col |
Optional vector of colors to be used for lines. Input NULL |
pch |
Optional vector of plot character values |
lty |
Optional vector of line types |
lwd |
Optional vector of line widths |
tickEndYr |
Logical flag: set TRUE or FALSE to switch to turn on/off extra axis mark at final year in timeseries plots. |
xlim |
Optional, years to use for x-axis. Default value NULL (or "default"), uses all years available. |
ylim |
Optional, min and max values for the ylim to override the
|
ylimAdj |
Multiplier for ylim parameter. Allows additional white space. |
xaxs |
Choice of xaxs parameter See |
yaxs |
Choice of yaxs parameter. See |
xylabs |
Logical flag. Enables x- and y-axis labels. |
type |
The type of plot to be drawn. For more details, see |
legend |
Flag to enable legend to plot. TRUE by default. |
legendlabels |
Optional vector of labels to include in legend. |
legendloc |
Location of legend. Either a string like "topleft" or a vector of two
numeric values representing the fraction of the maximum in the x and y
dimensions, respectively. See |
legendorder |
Optional vector of model numbers that can be used to have the legend display the model names in an order that is different than that which is represented in the summary input object. |
legendncol |
Number of columns for the legend. |
legendcex |
Allows to adjust legend cex |
legendsp |
Space between legend labels |
legendindex |
Allows to add legend for selected indices (plots) |
pwidth |
Default width of plot printed to plot in units of |
pheight |
Height of plot printed to plot in units of |
punits |
Measurement units for
|
res |
Resolution for plots printed to files. |
ptsize |
Point size for plotted text in plots printed in files. See |
cex.main |
Character expansion for plot titles. |
plotdir |
Directory where output plot file will be written. By default, it will be the directory where the model was run. |
filenameprefix |
Additional text to append to output plot file name. It will be separated from default name by an underscore. |
par |
A numerical vector of the form c(bottom, left, top, right) which
gives the number of lines of margin to be specified on the four sides of
the plot,which is passed to |
verbose |
Flag to print additional diagnostic messages to R console |
boxcol |
color boxes |
new |
Deprecated. New plot windows are created by default (TRUE), and the option to disable this, via FALSE, is unused. |
add |
suppresses |
Henning Winker (JRC-EC)
Generates a Kobe plot or phase plot illustrating the stock status uncertainty over SSB/SSBmsy and F/Fmsy
SSplotKobe( kb, joint = TRUE, year = NULL, posterior = c("points", "kernel"), xlab = expression(SSB/SSB[MSY]), ylab = expression(F/F[MSY]), ylim = NULL, xlim = NULL, fill = TRUE, showMedian = TRUE, legend = TRUE, legendpos = "right", legendcex = 0.7, legendruns = TRUE, yr.label = TRUE, yr.int = 5, verbose = TRUE )
SSplotKobe( kb, joint = TRUE, year = NULL, posterior = c("points", "kernel"), xlab = expression(SSB/SSB[MSY]), ylab = expression(F/F[MSY]), ylim = NULL, xlim = NULL, fill = TRUE, showMedian = TRUE, legend = TRUE, legendpos = "right", legendcex = 0.7, legendruns = TRUE, yr.label = TRUE, yr.int = 5, verbose = TRUE )
kb |
output from SSdeltaMVLN()["kb"] |
joint |
option FALSE shows individual runs |
year |
option to choose year for kobe, last year is default |
posterior |
visualization of posterior c("points","kernel") |
xlab |
graphic parameter |
ylab |
graphic parameter |
ylim |
graphic parameter |
xlim |
graphic parameter |
fill |
shows color-coded quadrants |
showMedian |
option for median trajectory. TRUE by default |
legend |
option for legend. TRUE by default. |
legendpos |
legend position |
legendcex |
legend size |
legendruns |
show legend for run labels |
yr.label |
show year along trajectory |
yr.int |
year intervals along trajectory |
verbose |
Output to R console. Default is TRUE |
Kobe Quadrant percentages
A function to plot SSB, B-ratio, F, Recruits, and/or Index of Abundance fits
from multiple SS models. This function uses an object of multiple SS models
summarized with r4ss::SSsummarize()
.
SSplotModelcomp( summaryoutput, plot = TRUE, print = deprecated(), print_plot = FALSE, png = deprecated(), use_png = print_plot, pdf = deprecated(), use_pdf = FALSE, models = "all", subplots = c("SSB", "Bratio", "Fvalue", "Recruits", "Index", "RecDevs"), brp = c("msy", "btargs"), fmsy = TRUE, ylabs = c("SSB (t)", expression(SSB/SSB[MSY]), "Fishing mortality F", "Recruits ('000s)", "Index", "Recruitment Deviations"), endyrvec = "default", xmin = NULL, indexselect = NULL, indexUncertainty = TRUE, col = NULL, pch = NULL, lty = 1, lwd = 2, tickEndYr = FALSE, xlim = "default", ylimAdj = 1.05, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "l", uncertainty = TRUE, legend = TRUE, legendlabels = "default", legendloc = "topright", legendorder = "default", legendncol = 1, legendcex = 1, legendsp = 0.9, legendindex = NULL, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, shadecol = NULL, shadealpha = 0.3, new = TRUE, add = FALSE, mcmcVec = FALSE, indexQlabel = TRUE, indexQdigits = 4, indexfleets = 1 )
SSplotModelcomp( summaryoutput, plot = TRUE, print = deprecated(), print_plot = FALSE, png = deprecated(), use_png = print_plot, pdf = deprecated(), use_pdf = FALSE, models = "all", subplots = c("SSB", "Bratio", "Fvalue", "Recruits", "Index", "RecDevs"), brp = c("msy", "btargs"), fmsy = TRUE, ylabs = c("SSB (t)", expression(SSB/SSB[MSY]), "Fishing mortality F", "Recruits ('000s)", "Index", "Recruitment Deviations"), endyrvec = "default", xmin = NULL, indexselect = NULL, indexUncertainty = TRUE, col = NULL, pch = NULL, lty = 1, lwd = 2, tickEndYr = FALSE, xlim = "default", ylimAdj = 1.05, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "l", uncertainty = TRUE, legend = TRUE, legendlabels = "default", legendloc = "topright", legendorder = "default", legendncol = 1, legendcex = 1, legendsp = 0.9, legendindex = NULL, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, shadecol = NULL, shadealpha = 0.3, new = TRUE, add = FALSE, mcmcVec = FALSE, indexQlabel = TRUE, indexQdigits = 4, indexfleets = 1 )
summaryoutput |
List created by |
plot |
DEPRECATED. By default, TRUE, Plots (and subplots) are drawn to the plot device. The option to explicitly disable this option (FALSE), is not implemented. This option flag will be defunct in a future version |
print |
DEPRECATED, please use |
print_plot |
Flag to enable plot graphic device to print to PNG or PNG files. |
png |
DEPRECATED. Please use |
use_png |
Enables plots to be generated to PNG files. Defaults to print value |
pdf |
DEPRECATED. Please use |
use_pdf |
Enables plots to be generated to pdf file. |
models |
Optional subset of the models of |
subplots |
option to "SSB","Bratio","Fvalue","Recruits","Index"
|
brp |
option to set reference point |
fmsy |
to specify |
ylabs |
yaxis labels for quants final year of values to show for each model. By default it is set to the |
endyrvec |
Optional single year or vector of years representing the
final year of values to show for each model. By |
xmin |
NULL optional number first year shown in plot (if available) |
indexselect |
Vector of fleet numbers for each model for which to compare |
indexUncertainty |
Show fixed uncertainty intervals on index (not estimated) |
col |
Optional vector of colors to be used for lines. Input NULL |
pch |
Optional vector of plot character values |
lty |
Optional vector of line types |
lwd |
Optional vector of line widths |
tickEndYr |
Logical flag: set TRUE or FALSE to switch to turn on/off extra axis mark at final year in timeseries plots. |
xlim |
Optional, years to use for x-axis. Default value NULL (or "default"), uses all years available. |
ylimAdj |
Multiplier for ylim parameter. Allows additional white space. |
xaxs |
Choice of xaxs parameter See |
yaxs |
Choice of yaxs parameter. See |
xylabs |
Logical flag: set TRUE or FALSE to include x- and y-axis labels to the plot. Defaults to TRUE |
type |
The type of plot to be drawn. For more details, see |
uncertainty |
Logical flag to enable plots with uncertainty intervals. Either a single TRUE/FALSE value, or a vector of TRUE/FALSE values around SSB or F estimated timeseries, or a set of integers corresponding to the choice of models. |
legend |
Flag to enable legend to plot. TRUE by default. |
legendlabels |
Optional vector of labels to include in legend. |
legendloc |
Location of legend. Either a string like "topleft" or a vector of two
numeric values representing the fraction of the maximum in the x and y
dimensions, respectively. See |
legendorder |
Optional vector of model numbers that can be used to have the legend display the model names in an order that is different than that which is represented in the summary input object. |
legendncol |
Number of columns for the legend. |
legendcex |
Allows to adjust legend cex |
legendsp |
Space between legend labels |
legendindex |
Allows to add legend for selected indices (plots) |
pwidth |
Default width of plot printed to plot in units of |
pheight |
Height of plot printed to plot in units of |
punits |
Measurement units for
|
res |
Resolution for plots printed to files. |
ptsize |
Point size for plotted text in plots printed in files. See |
cex.main |
Character expansion for plot titles. |
plotdir |
Directory where output plot file will be written. By default, it will be the directory where the model was run. |
filenameprefix |
Additional text to append to output plot file name. It will be separated from default name by an underscore. |
par |
A numerical vector of the form c(bottom, left, top, right) which
gives the number of lines of margin to be specified on the four sides of
the plot,which is passed to |
verbose |
Flag to print additional diagnostic messages to R console |
shadecol |
uncertainty shading of hcxval horizon |
shadealpha |
Transparency adjustment used to make default shadecol |
new |
Deprecated. New plot windows are created by default (TRUE), and the option to disable this, via FALSE, is unused. |
add |
suppresses |
mcmcVec |
Logical vector of TRUE/FALSE values (or single value) indicating whether input values are from MCMC or to use normal distribution around MLE. |
indexQlabel |
Logical. If TRUE add catchability to legend in plot of index fits (currently not used) |
indexQdigits |
Number of significant digits for catchability in legend |
indexfleets |
Fleet numbers for each model to compare indices of abundance. Can take different forms:
|
Mostly adopted from r4ss::SSplotComparisons by Taylor et al
Plots retrospective pattern, including (optional) one-step ahead forecast and computes Mohn's Rho
SSplotRetro( summaryoutput, subplots = c("SSB", "F"), plot = TRUE, print = deprecated(), print_plot = FALSE, png = deprecated(), use_png = print_plot, pdf = deprecated(), use_pdf = FALSE, models = "all", endyrvec = "default", xlim = NULL, xmin = NULL, labels = NULL, ylim = NULL, forecast = TRUE, forecastrho = TRUE, showrho = TRUE, col = NULL, pch = NULL, lty = 1, lwd = 2, tickEndYr = TRUE, ylimAdj = 1.05, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "o", uncertainty = TRUE, legend = TRUE, legendlabels = "default", legendloc = "topright", legendorder = "default", legendncol = 1, legendcex = 1, legendsp = 0.7, legendindex = NULL, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, shadecol = grey(0.4, 0.6), new = TRUE, add = FALSE, mcmcVec = FALSE, shadecol1 = grey(0.5, 0.4), indexQlabel = TRUE, indexQdigits = 4, shadealpha = 0.3 )
SSplotRetro( summaryoutput, subplots = c("SSB", "F"), plot = TRUE, print = deprecated(), print_plot = FALSE, png = deprecated(), use_png = print_plot, pdf = deprecated(), use_pdf = FALSE, models = "all", endyrvec = "default", xlim = NULL, xmin = NULL, labels = NULL, ylim = NULL, forecast = TRUE, forecastrho = TRUE, showrho = TRUE, col = NULL, pch = NULL, lty = 1, lwd = 2, tickEndYr = TRUE, ylimAdj = 1.05, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "o", uncertainty = TRUE, legend = TRUE, legendlabels = "default", legendloc = "topright", legendorder = "default", legendncol = 1, legendcex = 1, legendsp = 0.7, legendindex = NULL, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, shadecol = grey(0.4, 0.6), new = TRUE, add = FALSE, mcmcVec = FALSE, shadecol1 = grey(0.5, 0.4), indexQlabel = TRUE, indexQdigits = 4, shadealpha = 0.3 )
summaryoutput |
List created by |
subplots |
Optional vector of subplots to be created:
|
plot |
DEPRECATED. By default, TRUE, Plots (and subplots) are drawn to the plot device. The option to explicitly disable this option (FALSE), is not implemented. This option flag will be defunct in a future version |
print |
DEPRECATED, please use |
print_plot |
Flag to enable plot graphic device to print to PNG or PNG files. |
png |
DEPRECATED. Please use |
use_png |
Enables plots to be generated to PNG files. Defaults to print value |
pdf |
DEPRECATED. Please use |
use_pdf |
Enables plots to be generated to pdf file. |
models |
Optional subset of the models of |
endyrvec |
Optional single year or vector of years representing the final year of values to show for each model. By default it is set to the ending year specified in each model. |
xlim |
Optional, years to use for x-axis. Default value NULL (or "default"), uses all years available. |
xmin |
optional minimum year shown in plot (default first yr) |
labels |
|
ylim |
option to specify |
forecast |
Logical. If TRUE, one-step ahead forecasts are shown in plot |
forecastrho |
Logical. If TRUE, one-step ahead forecast rho value is denoted in plot |
showrho |
Logical flag to include Mohn's rho value. Defaults to TRUE |
col |
Optional vector of colors to be used for lines. Input NULL |
pch |
Optional vector of plot character values |
lty |
Optional vector of line types |
lwd |
Optional vector of line widths |
tickEndYr |
Logical flag: set TRUE or FALSE to switch to turn on/off extra axis mark at final year in timeseries plots. |
ylimAdj |
Multiplier for ylim parameter. Allows additional white space. |
xaxs |
Choice of xaxs parameter See |
yaxs |
Choice of yaxs parameter. See |
xylabs |
Logical flag: set TRUE or FALSE to include x- and y-axis labels to the plot. Defaults to TRUE |
type |
The type of plot to be drawn. For more details, see |
uncertainty |
Logical flag to enable plots with uncertainty intervals. Either a single TRUE/FALSE value, or a vector of TRUE/FALSE values around SSB or F estimated timeseries, or a set of integers corresponding to the choice of models. |
legend |
Flag to enable legend to plot. TRUE by default. |
legendlabels |
Optional vector of labels to include in legend. |
legendloc |
Location of legend. Either a string like "topleft" or a vector of two
numeric values representing the fraction of the maximum in the x and y
dimensions, respectively. See |
legendorder |
Optional vector of model numbers that can be used to have the legend display the model names in an order that is different than that which is represented in the summary input object. |
legendncol |
Number of columns for the legend. |
legendcex |
Allows to adjust legend cex |
legendsp |
Space between legend labels |
legendindex |
Allows to add legend for selected indices (plots) |
pwidth |
Default width of plot printed to plot in units of |
pheight |
Height of plot printed to plot in units of |
punits |
Measurement units for
|
res |
Resolution for plots printed to files. |
ptsize |
Point size for plotted text in plots printed in files. See |
cex.main |
Character expansion for plot titles. |
plotdir |
Directory where output plot file will be written. By default, it will be the directory where the model was run. |
filenameprefix |
Additional text to append to output plot file name. It will be separated from default name by an underscore. |
par |
A numerical vector of the form c(bottom, left, top, right) which
gives the number of lines of margin to be specified on the four sides of
the plot,which is passed to |
verbose |
Flag to print additional diagnostic messages to R console |
shadecol |
uncertainty shading of hcxval horizon |
new |
Deprecated. New plot windows are created by default (TRUE), and the option to disable this, via FALSE, is unused. |
add |
suppresses |
mcmcVec |
Logical vector of TRUE/FALSE values (or single value) indicating whether input values are from MCMC or to use normal distribution around MLE. |
shadecol1 |
uncertainty shading of early years not affected by hindcast |
indexQlabel |
Logical. If TRUE, add catchability to legend in plot of index fits (currently not used) |
indexQdigits |
Number of significant digits for catchability in legend |
shadealpha |
set the transparency level (alpha) of the area of uncertainty. Defaults to 0.3 (currently not used) |
Henning Winker (JRC-EC) and Laurance Kell (Sea++)
Function for residual diagnostics. Plots residuals and 3x sigma limits for
indices or mean age or length and outputs a runs test table. Note, if you do
not want to plot the residuals, use SSrunstest()
.
SSplotRunstest( ss3rep, mixing = "less", subplots = c("cpue", "len", "age", "size", "con")[1], plot = TRUE, print = deprecated(), print_plot = FALSE, png = deprecated(), use_png = print_plot, pdf = deprecated(), use_pdf = FALSE, indexselect = NULL, miny = 1, col = NULL, pch = 21, lty = 1, lwd = 2, tickEndYr = FALSE, xlim = "default", ylim = "default", ylimAdj = 1.4, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "o", legend = TRUE, legendloc = "top", legendcex = 1, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, new = TRUE, add = FALSE )
SSplotRunstest( ss3rep, mixing = "less", subplots = c("cpue", "len", "age", "size", "con")[1], plot = TRUE, print = deprecated(), print_plot = FALSE, png = deprecated(), use_png = print_plot, pdf = deprecated(), use_pdf = FALSE, indexselect = NULL, miny = 1, col = NULL, pch = 21, lty = 1, lwd = 2, tickEndYr = FALSE, xlim = "default", ylim = "default", ylimAdj = 1.4, xaxs = "i", yaxs = "i", xylabs = TRUE, type = "o", legend = TRUE, legendloc = "top", legendcex = 1, pwidth = 6.5, pheight = 5, punits = "in", res = 300, ptsize = 10, cex.main = 1, plotdir = NULL, filenameprefix = "", par = list(mar = c(5, 4, 1, 1) + 0.1), verbose = TRUE, new = TRUE, add = FALSE )
ss3rep |
Stock Synthesis output as read by |
mixing |
|
subplots |
optional flag for:
|
plot |
DEPRECATED. By default, TRUE, Plots (and subplots) are drawn to the plot device. The option to explicitly disable this option (FALSE), is not implemented. This option flag will be defunct in a future version |
print |
DEPRECATED, please use |
print_plot |
Flag to enable plot graphic device to print to PNG or PNG files. |
png |
DEPRECATED. Please use |
use_png |
Enables plots to be generated to PNG files. Defaults to print value |
pdf |
DEPRECATED. Please use |
use_pdf |
Enables plots to be generated to pdf file. |
indexselect |
Vector of fleet numbers for each model for which to compare |
miny |
the absolute value of the min and max value for |
col |
Optional vector of colors to be used for lines. Input NULL |
pch |
Optional vector of plot character values |
lty |
Optional vector of line types |
lwd |
Optional vector of line widths |
tickEndYr |
Logical flag: set TRUE or FALSE to switch to turn on/off extra axis mark at final year in timeseries plots. |
xlim |
Optional, years to use for x-axis. Default value NULL (or "default"), uses all years available. |
ylim |
Optional, values for y-axis range to display on plot.
The default: |
ylimAdj |
Multiplier for ylim parameter. Allows additional white space. |
xaxs |
Choice of xaxs parameter See |
yaxs |
Choice of yaxs parameter. See |
xylabs |
Logical flag: set TRUE or FALSE to include x- and y-axis labels to the plot. Defaults to TRUE |
type |
The type of plot to be drawn. For more details, see |
legend |
Flag to enable legend to plot. TRUE by default. |
legendloc |
Location of legend. Either a string like "topleft" or a
vector of two numeric values representing the fraction of the maximum in
the x and y dimensions, respectively. See |
legendcex |
Allows to adjust legend cex |
pwidth |
Default width of plot printed to plot in units of |
pheight |
Height of plot printed to plot in units of |
punits |
Measurement units for
|
res |
Resolution for plots printed to files. |
ptsize |
Point size for plotted text in plots printed in files. See |
cex.main |
Character expansion for plot titles. |
plotdir |
Directory where output plot file will be written. By default, it will be the directory where the model was run. |
filenameprefix |
Additional text to append to output plot file name. It will be separated from default name by an underscore. |
par |
A numerical vector of the form c(bottom, left, top, right) which
gives the number of lines of margin to be specified on the four sides of
the plot,which is passed to |
verbose |
Flag to print additional diagnostic messages to R console |
new |
Deprecated. New plot windows are created by default (TRUE), and the option to disable this, via FALSE, is unused. |
add |
suppresses |
a dataframe with runs test p-value, if the test has passed or failed, 3x sigma high and low limits, and the type of data used. Rows are for each fleet. Note, runs test passed if p-value > 0.05 (residuals are random) and failed if p-value < 0.5 (residuals are not random)
Henning Winker (JRC-EC) and Laurance Kell (Sea++)
A function to read mcmc file outputs from a Stock Synthesis model
SSreadMCMC(mcmcdir)
SSreadMCMC(mcmcdir)
mcmcdir |
file path for folder with the derived_posteriors.sso file |
Stock Synthesis mcmc output file
Henning Winker (JRC-EC) & Laurence Kell (Sea++)
Wrapper to get observed and expected mean length/age from multiple Stock Synthesis models.
SSretroComps(retroModels)
SSretroComps(retroModels)
retroModels |
object list of replists from r4ss::SSgetoutput() |
list of observed and expected mean Length/age comps (c.f. ss3rep[["cpue"]]
)
Henning Winker
SSplotJABBAres()
Function for calculating RMSE
used for SSplotJABBAres()
SSrmse( ss3rep, quants = c("cpue", "len", "age", "con"), seas = NULL, indexselect = NULL )
SSrmse( ss3rep, quants = c("cpue", "len", "age", "con"), seas = NULL, indexselect = NULL )
ss3rep |
output from |
quants |
the dataset to calculate RMSE for. "cpue" for index of abundance, "len" for length comp, "age" for age composition, and "con" for conditional age-at-length. |
seas |
string indicating how to treat data from multiple seasons 'comb' - combine seasonal data for each year and plot against Yr 'sep' - treat season separately, plotting against Yr.S. If is.null(seas), it is assumed that there is only one season and option 'comb' is used. |
indexselect |
Vector of fleet numbers for each model for which to compare |
returns a list that includes the RMSE table output (by fleet and combined) and the dataframe of residuals which can be used for creating the SSplotJABBAres()
plot
This function uses randtests::runs.test to do perform a runs test on residuals to determine if they are randomly distributed. It also calculates the 3 x sigma limits
ssruns_sig3(x, type = NULL, mixing = "less")
ssruns_sig3(x, type = NULL, mixing = "less")
x |
residuals from CPUE fits |
type |
only |
mixing |
|
runs test is conducted with library(randtests)
runs p value and 3 x sigma limits
Henning Winker (JRC-EC) and Laurence Kell (Sea++)
Function for residual diagnostics. Outputs a runs test table that gives runs test p-values, if the runs test passed (p-value > 0.05, residuals are random) or failed (p-value < 0.05, residuals are not random), the 3x sigma limits for indices or mean age or length and the type of input data (cpue, length comp, age comp, size comp, or conditional age-at-length).
SSrunstest( ss3rep, mixing = "less", quants = c("cpue", "len", "age", "con")[1], indexselect = NULL, verbose = TRUE )
SSrunstest( ss3rep, mixing = "less", quants = c("cpue", "len", "age", "con")[1], indexselect = NULL, verbose = TRUE )
ss3rep |
Stock Synthesis output as read by |
mixing |
|
quants |
optional use of
|
indexselect |
Vector of fleet numbers for each model for which to compare |
verbose |
Report progress to R GUI? |
a dataframe with runs test p-value, if the test has passed or failed, 3x sigma high and low limits, and the type of data used. Rows are for each fleet. Note, runs test passed if p-value > 0.05 (residuals are random) and failed if p-value < 0.5 (residuals are not random)
Henning Winker (JRC-EC) and Laurance Kell (Sea++)
A function to get Bratio and F settings
SSsettingsBratioF(ss3rep, status = c("Bratio", "F"), verbose = TRUE)
SSsettingsBratioF(ss3rep, status = c("Bratio", "F"), verbose = TRUE)
ss3rep |
from r4ss::SSgetoutput() |
status |
covarying stock status quantaties to extract from Hessian |
verbose |
Report progress to R GUI? |
output list with Bratio and F settings
Henning Winker (JRC-EC)