eqsim_run: Simulates the Equilibrium Results for a Population.

View source: R/eqsim_run.R

eqsim_runR Documentation

Simulates the Equilibrium Results for a Population.

Description

Simulate a fish stock forward in time given biological parameters, fishery parameters and advice parameters.

Usage

eqsim_run(
  fit,
  bio.years = c(-5, -1) + FLCore::dims(fit$stk)$maxyear,
  bio.const = FALSE,
  sel.years = c(-5, -1) + FLCore::dims(fit$stk)$maxyear,
  sel.const = FALSE,
  Fscan = seq(0, 2, len = 40),
  Fcv = 0,
  Fphi = 0,
  SSBcv = 0,
  rhologRec = TRUE,
  Blim,
  Bpa,
  recruitment.trim = c(3, -3),
  Btrigger = 0,
  Nrun = 200,
  process.error = TRUE,
  verbose = TRUE,
  extreme.trim = c(0, 1),
  R.initial = mean(fit$rby$rec),
  keep.sims = FALSE
)

Arguments

fit

A list returned from the function fitModels

bio.years

The years to sample maturity, weights and M from, given as a vector of length 2, i.e. c(2010, 2015) select from the years 2010 to 2015 inclusive.

bio.const

A flag (default FALSE), if TRUE mean of the biological values from the years selected are used

sel.years

The years to sample the selection patterns from, given as a vector of length 2, i.e. c(2010, 2015) select from the years 2010 to 2015 inclusive.

sel.const

A flag (default FALSE), if TRUE mean of the selection patterns from the years selected are used

Fscan

F values to scan over, i.e. seq(0, 2, by = 0.05)

Fcv

Assessment error in the advisory year

Fphi

Autocorrelation in assessment error in the advisory year

SSBcv

Spawning stock biomass error in the advisory year

rhologRec

A flag for recruitment autocorrelation, default (TRUE), or a vector of numeric values specifcying the autocorrelation parameter for the residuals for each SR model.

Blim

SSB limit reference point

Bpa

SSB precuationary reference point

recruitment.trim

A numeric vector with two log-value clipping the extreme recruitment values from a continuous lognormal distribution. The values must be set as c("high","low").

Btrigger

If other than 0 (default) the target F applied is reduced by SSB/Btrigger. This is the "ICES Advice Rule".

Nrun

The number of years to run in total (the last 50 years from that will be retained to compute equilibrium values from)

process.error

Use stochastic recruitment or mean recruitment? TRUE (default) uses the predictive distribution of recruitment, model estimate of recruitment + simulated observation error. FALSE uses model prediction of recruitment with no observation error.

verbose

Flag, if TRUE (default) indication of the progress of the simulation is provided in the console. Useful to turn to FALSE when knitting documents.

extreme.trim

a pair of quantiles (low, high) which are used to trim the equilibrium catch values, across simulations within an F scenario, when calculating the mean catch and landings for that F scenario. These mean values calculated accross simulations within an F scenario are used to find which F scenario gave the maximum catch. extreme.trim can therefore be used to stablise the estimate of mean equilibrium catch and landings by F scenario. The default is c(0, 1) which includes all the data and is effectively an untrimmed mean.

R.initial

Initial recruitment for the simulations. This is common accross all simulations. Default = mean of all recruitments in the series.

keep.sims

Flag, if TRUE returns a matrix of population tragectories for each value of F in Fscan (see examples).

Details

Details of the steps required to evaluate reference points are given in ICES (2017). WHile, details of the calculation of MSY ranges is given in ICES (2015).

Value

A list containing the results from the forward simulation and the reference points calculated from it.

References

ICES (2015) Report of the Workshop to consider F MSY ranges for stocks in ICES categories 1 and 2 in Western Waters (WKMSYREF4). 01 WKMSYREF4 Report.pdf

ICES (2017) ICES fisheries management reference points for category 1 and 2 stocks. DOI: 10.17895/ices.pub.3036

See Also

eqsr_fit fits multiple stock recruitment models to a data set.

eqsr_plot plots the results from eqsr_fit.

eqsim_plot summary plot of the forward simulation showing estimates of various reference points.

eqsim_plot_range summary plots of the forward simulation showing the estimates of MSY ranges (ICES, 2015)

msy-package gives an overview of the package.

Examples

## Not run: 
data(icesStocks)
FIT <- eqsr_fit(icesStocks$saiNS,
                nsamp = 1000,
                models = c("Ricker", "Segreg"))
SIM <-
  eqsim_run(
    FIT,
    bio.years = c(2004, 2013),
    sel.years = c(2004, 2013),
    Fcv = 0.24,
    Fphi = 0.42,
    Blim = 106000,
    Bpa = 200000,
    Fscan = seq(0, 1.2, len = 40)
   )

# extract tragectories
ssbsim <- SIM$rbya$ssb
years <- SIM$rbya$simyears
models <- SIM$rbya$srmodels$model
Ftarget <- SIM$rbya$Ftarget

Fval <- which(Ftarget == 0)
Fval <- which(Ftarget > .3)[1]
x <- ssbsim[Fval,,]
df <- data.frame(year = 1:nrow(x),
                 ssb = c(x),
                 sim = rep(1:ncol(x), each = nrow(x)),
                 model = rep(models, each = nrow(x)))
xyplot(ssb ~ year | model, groups = sim, data = df, type = "l", col = grey(0.5, alpha = 0.5))

fit <- density(x[x>1e-3], from = 0)
plot(fit$x,fit$y*mean(x>1e-3),col="red", type = "l")
lines(x = 0, y = mean(x<=1e-3), type = "h", lwd = 3)


## End(Not run)


ices-tools-prod/msy documentation built on Nov. 3, 2022, 6:41 p.m.