build_jabba: Creates a data list used as input to JAGS

View source: R/build_jabba.R

build_jabbaR Documentation

Creates a data list used as input to JAGS

Description

Creates a data list with JABBA input and settings to be passed to fit_jabba()

Usage

build_jabba(
  catch = NULL,
  cpue = NULL,
  se = NULL,
  auxiliary = NULL,
  auxiliary.se = NULL,
  auxiliary.type = c("z", "effort", "bk", "bbmsy", "ffmsy")[1],
  assessment = "jabba",
  scenario = "jabba",
  model.type = c("Schaefer", "Fox", "Pella", "Pella_m"),
  add.catch.CV = TRUE,
  catch.cv = 0.1,
  catch.error = c("random", "under")[1],
  Plim = 0,
  r.dist = c("lnorm", "range"),
  r.prior = c(0.2, 0.5),
  K.dist = c("lnorm", "range"),
  K.prior = NULL,
  psi.dist = c("lnorm", "beta"),
  psi.prior = c(0.9, 0.25),
  b.prior = c(FALSE, 0.3, NA, c("bk", "bbmsy", "ffmsy")[1]),
  BmsyK = 0.4,
  shape.CV = 0.3,
  sets.q = 1:(ncol(cpue) - 1),
  sigma.est = TRUE,
  sets.var = 1:(ncol(cpue) - 1),
  fixed.obsE = ifelse(is.null(se), 0.1, 0.001),
  auxiliary.obsE = ifelse(is.null(auxiliary.se), 0.1, 0.001),
  auxiliary.sigma = TRUE,
  auxiliary.lag = 1,
  qA.cv = 0.1,
  sets.varA = 1:(ncol(auxiliary) - 1),
  sigma.proc = TRUE,
  proc.dev.all = TRUE,
  igamma = c(4, 0.01),
  projection = FALSE,
  TACs = NULL,
  TACint = NULL,
  imp.yr = NULL,
  pyrs = NULL,
  P_bound = c(0.02, 1.3),
  sigmaobs_bound = 1,
  sigmaproc_bound = 0.2,
  q_bounds = c(10^-30, 1000),
  K_bounds = c(0.01, 10^10),
  qA_bounds = c(10^-30, 1000),
  harvest.label = c("Hmsy", "Fmsy")[2],
  catch.metric = "(t)",
  verbose = TRUE
)

Arguments

catch

catch time series, requires data.frame(year, catch)

cpue

cpue time series, requires data.frame(year, cpue.1,cpue.2,...,cpue.N)

se

optional log standard error (CV) time series,requires data.frame(year, se.1,se.2,...,se.N)

auxiliary

additional time series of either c(Z,Effort,B/B0,B/Bmsy,F/Fmsy)

auxiliary.type

c("effort","z","bk","bbmsy","ffmsy")

assessment

= "example",

scenario

= "s1",

model.type

= c("Schaefer","Fox","Pella","Pella_m"),

add.catch.CV

= c(TRUE,FALSE) option estimate catch with error

catch.cv

catch error on log-scale (default = 0.1)

catch.error

can be random or directional under reporting "under"

Plim

= 0, # Set Plim = Blim/K where recruitment may become impaired (e.g. Plim = 0.25) PRIORS

r.dist

= c("lnorm","range"), # prior distribution for the intrinsic rate population increas

r.prior

= c(0.2,0.5), # prior(mu, lod.sd) for intrinsic rate of population increase

K.dist

= c("lnorm","range"), # prior distribution for unfished biomass K = B0

K.prior

= NULL, # prior(mu,CV) for the unfished biomass K = B0

psi.dist

= c("lnorm","beta"), # prior distribution for the initial biomass depletion B[1]/K

psi.prior

= c(0.9,0.25), # prior(mu, CV) for the initial biomass depletion B[1]/K

b.prior

= c(FALSE,0.3,NA,c("bk","bbmy","ffmsy")[1]), # depletion prior set as d.prior = c(mean,cv,yr,type=c("bk","bbmsy"))

BmsyK

= 0.4, # Inflection point of the surplus production curve, requires Pella-Tomlinson (model = 3 | model 4)

shape.CV

= 0.3, # CV of the shape m parameters, if estimated with Pella-Tomlinson (Model 4) VARIANCE options

sets.q

= 1:(ncol(cpue)-1), # assigns catchability q to different CPUE indices. Default is each index a seperate q

sigma.est

= TRUE, # Estimate additional observation variance

sets.var

= 1:(ncol(cpue)-1), # estimate individual additional variace

fixed.obsE

# Minimum fixed observation error

auxiliary.obsE

# Fixed observation error for auxiliary data

auxiliary.sigma

# TRUE/FALSE

auxiliary.lag

lag option in years (default 1) for effort, z and ffmsy

qA.cv

precision on lognormal prior for e.g. qA*Z (not applicable to effort)

sigma.proc

= TRUE, # TRUE: Estimate process error, else set to value

proc.dev.all

= TRUE, # TRUE: All year, year = starting year

igamma

= c(3,0.01), # prior for process error variance, default informative igamma ~ mean 0.07, CV 0.4

projection

= FALSE, # Switch on by Projection = TRUE

TACs

= NULL

TACint

= NULL, # default avg last 3 years

imp.yr

= NULL, # default last year plus ONE

pyrs

= NULL, # Set number of projections years

P_bound

= c(0.02,1.3), # Soft penalty bounds for b/k

sigmaobs_bound

= 1, # Adds an upper bound to the observation variance

sigmaproc_bound

= 0.2, # Adds an upper bound to the process variance

qA_bounds

Defines lower and upper bounds for q of auxiliary data type effort

harvest.label

= c("Hmsy","Fmsy")[2], # choose label preference H/Hmsy versus Fmsy

catch.metric

"(t)" # Define catch input metric e.g. (tons) "000 t"

verbose

option show cat comments

auxiliary, se

optional input standard errors on auxilary data

q_bounds=

c(10^-30,1000), # Defines lower and upper bounds for q

K_bounds=

c(0.01,10^10), # Defines lower and upper bounds for K

Value

List to be used as data input to JABBA JAGS model.


jabbamodel/JABBA documentation built on Nov. 2, 2024, 12:50 p.m.