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
Usage
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)
)
Arguments
- retroSummary
List created by
r4ss::SSsummarize()
orSSretroComps()
- subplots
optional use of the following:
"cpue"
Index of abundance data"len"
Length-composition data"age"
Age-composition data
- Season
option to specify Season as an integer of value 1-4. Default uses first available, i.e. usual Seas = 1
DEPRECATED, please use
print_plot
.- print_plot
Flag to enable plot graphic device to print to PNG or PNG files.
- png
DEPRECATED. Please use
use_png
.- use_png
Enables plots to be generated to PNG files. Defaults to print value
DEPRECATED. Please use
use_pdf
.- use_pdf
Enables plots to be generated to pdf file.
- models
Optional subset of the models of
summaryoutput
(or a similar field with a different name): a list created by the function r4ss::SSsummarize. 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.
- 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
MASE
denominator (naive predictions) forMASE.adj
(default = 0.1)- show.mase.adj
if TRUE, it show
mase.adj
in plot- 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
ylimAdj
if specified- xaxs
Choice of xaxs parameter See
?par
for more info.- yaxs
Choice of yaxs parameter. See
?par
for more info.- 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
plot
.- 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
help("legend")
for more info on the string options.- 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
punits
- pheight
Height of plot printed to plot in units of
punits
- punits
Measurement units for
pwidth
andpheight
. Default is"in"
."px"
(pixels)"in"
(inches)"cm"
(centimeters)"mm"
(millimeters)
- res
Resolution for plots printed to files.
- ptsize
Point size for plotted text in plots printed in files. See
help("png")
for more details- 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
par()
. EnteringNULL
passes plot's defaultpar()
values (which depends on whether the main title is included or not)- 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
shadecol
. (currently not used)- new
Deprecated. New plot windows are created by default (TRUE), and the option to disable this, via FALSE, is unused.
- add
suppresses
par()
to create multiplot figs- 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:
integer: (default) create a single comparison plot for the chosen index
NULL: create a separate plot for each index as long as the fleet numbering is the same across all models.
vector of length equal to number of models: a single fleet number for each model to be compared in a single plot
list: list of fleet numbers associated with indices within each model to be compared, where the list elements are each a vector of the same length but the names of the list elements don't matter and can be absent.
- 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)