diag_stability
determines whether the model reaches a steady state
over the last n years of a run. Stability is loosely defined as a species/groups biomass reaching a
stable level (measured as having tolerable trend in a defined time range).
diag_stability(
fgs,
biomind,
initialYr = 1964,
speciesCodes,
nYrs = 20,
relChangeThreshold = 0.01
)
A character string. Path to location of functional groups file.
A character string. Path to the BiomIndx.txt file.
Numeric Scalar. Year in which the model run was initiated. (Default = 1964)
Character vector. A vector of Atlantis species codes in which to test for stability.
(Default = NULL, uses all species found in modelBiomass
)
Numeric scalar. Number of years from the end of the time series that stability must occur. (Default = 20 years)
Numeric Scalar. Maximum magnitude of relative change of slope (Default = 0.01)
Returns a data frame of all species and how they measure up against the stability criterion
Atlantis Code for species/functional group
The common name of the species/functional group
Value of fitted biomass for the first of year data used in the fit
Double. The value of the slope parameter (year)
Rate of increase relative to t1Fit
(mtPerYear
/t1Fit
)
mean biomass for the last nYrs
years
Logical. Does the species/group pass the test for stability
Formally the following model is fit to the last n years of the run:
$$biomass_t = \mu + \beta.t + \epsilon_t where \epsilon_t ~ IID N(0,\sigma^2)$$
where null hypothesis, $$H0:\beta=0$$
Note: annual biomass is used in fitting. Species with mean annual biomass < 1 metric ton over the last n years of the run are not considered stable. They are reported to Fail the test and NaNs returned
Other diags:
diag_fleet_catch()
,
diag_persistence()
,
diag_reasonability()
if (FALSE) { # \dontrun{
# Declare paths to files required
biomind <- paste("Full path to file","xxxBiomIndx.txt")
fgs <- paste("Full path to file","functioalGgroups.csv")
# Perform stability test on all species/groups using the last 20 years of the run
diag_stability(fgs, biomind, nYrs = 20)
# Only perform test on herring and white hake.
# Require stability over the last 10 years of the run and and use a
# relative change in the slope = 0.01 as the criterion for pass or fail
diag_stability(fgs,biomind, speciesCodes=c("HER","WHK"), nYrs = 10, relChangeThreshold = 0.01)
} # }