ypr.FLIBM: Perform a yeild-per-recruit (YPR) analysis on an FLIBM object

View source: R/ypr.FLIBM.R

ypr.FLIBMR Documentation

Perform a yeild-per-recruit (YPR) analysis on an FLIBM object

Description

bla

Usage

ypr.FLIBM(
  obj = NULL,
  ssbfec = 1e+06,
  FMs = seq(0, 1, 0.05),
  years = dimnames(obj$stock.a)$year,
  purgeProb = 0.2,
  parallel = TRUE,
  no_cores = detectCores() - 1,
  clusterType = "PSOCK",
  outfile = "output.txt",
  seed = 1
)

Arguments

obj

FLIBM object.

ssbfec

numeric value. Single value describing constant spawning stock biomass (or fecundity), used in determining recruitment with obj$rec during the first year of simulation.

FMs

numeric vector. Sequence of maximum fishing mortalities to be applied.

years

character vector. Years to use in simulation (from dimnames(obj$stock.a@stock.n) )

purgeProb

numeric Value between 0 and 1, indicating the frequency that obj$inds are purged of empty rows (passed to 'remove.ids').

parallel

logical. Simulations run in parallel.

no_cores

numeric value. Number of cores to use when parallel = TRUE (Default: no_cores = detectCores() - 1)

clusterType

(Default: 'clusterType = "PSOCK"')

outfile

character. Text file name (Default: 'outfile = "output.txt"') which will records the progress of the permutation completions.

seed

seed value for random number reproducibility (Default: 1). When seed = NULL, a random seed is used during each FM run.

Value

data.frame

Examples


data(stkMed)

# obj$rec parameters should result in high recruitment for the given
# ssbfec setting (e.g. many thousands of individuals will result in
# smoother ypr pattern)
stkMed$rec$params$rmax <- 1e4



system.time(
  resdf <- ypr.FLIBM(obj = stkMed, ssbfec = 1e6, parallel = TRUE,
    FMs = seq(0,0.6,len=12), seed = 1)
)

plot(SSB ~ FM, resdf, t = "o")
plot(Catch/Recr ~ FM, resdf, t = "o")
plot(Lopt ~ FM, resdf, t = "o")

# with refptPlot
calcRefpts(resdf, ypr=TRUE, spar=0.2)



marchtaylor/FLIBM documentation built on Jan. 19, 2025, 10:56 p.m.