abund_rel: Calculate relative abundance

Description Usage Arguments Value Examples

View source: R/24_abund_rel.R

Description

Calculates the expected abundance relative to zero exploitation, years.vec years after projections start

Usage

1
abund_rel(traj, zero.traj, K = NA, years.vec = c(10, 20, 50), fulldist = TRUE)

Arguments

traj

a matrix of trajectories, with rows=nsims and cols=nyears. Can be produced from projections()

zero.traj

a matrix of trajectories, same as traj but unfished. CHECK to make sure both start at the same simulation, in the app code.

K

if calculating abundance relative to K, put in K.

years.vec

a vector of years to check abundances at. E.g., how many years after the start of projections do you want to know abundance?

fulldist

logical saying whether to return the full distribution of relative abundances or the median of all the relative abundances.

Value

a vector of abundance relative to K or zero-exploitation where nrows=length of years.vec (10 years after, 20 years, etc.) and ncol=number of simulations.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
parms <- list(
  S0 = 0.944, S1plus = 0.99,
  K1plus = 9000,
  AgeMat = 18, nages = 20,
  z = 2.39, lambdaMax = 1.02
)
initdepl <- 0.5
traj <- projections(
  NOut = 50,
  ConstantBycatch = list(
    Catch = 50,
    CV = 0.3
  ),
  InitDepl = initdepl,
  lh.params = parms,
  nyears = 100
)$trajectories
traj0 <- projections(
  NOut = 50,
  ConstantBycatch = list(
    Catch = 0,
    CV = 0
  ),
  InitDepl = initdepl,
  lh.params = parms,
  nyears = 100
)$trajectories
abund_rel(traj = traj, zero.traj = traj0, K = parms$K1plus)

ktmurray1219/mmrefpoints documentation built on Dec. 21, 2021, 8:40 a.m.