Statistical catch-at-age method of the a4a stock assessment framework.

sca(stock, indices, ...)

# S4 method for FLStock,FLIndex
sca(stock, indices, ...)

# S4 method for FLStock,FLIndices
sca(
  stock,
  indices,
  fmodel = missing,
  qmodel = missing,
  srmodel = missing,
  n1model = missing,
  vmodel = missing,
  covar = missing,
  wkdir = missing,
  verbose = FALSE,
  fit = "assessment",
  center = TRUE,
  mcmc = missing
)

Arguments

stock

an FLStock object containing catch and stock information

indices

an FLIndices object containing survey indices

...

additional argument list that might never be used

fmodel

a formula object depicting the model for log fishing mortality at age

qmodel

a list of formula objects depicting the models for log survey catchability at age

srmodel

a formula object depicting the model for log recruitment

n1model

a formula object depicting the model for the population in the first year of the time series

vmodel

a list of formula objects depicting the model for the variance of fishing mortality and the indices

covar

a list with covariates to be used by the submodels. The formula must have an element with the same name as the list element.

wkdir

used to set a working directory for the admb optimiser; if wkdir is set, all admb files are saved to this folder, otherwise they are deleted.

verbose

if true, admb fitting information is printed to the screen.

fit

character with type of fit: 'MP' or 'assessment'; the former does not require the hessian to be computed, while the latter does.

center,

logical defining if the data should be centered before fitting.

mcmc

an SCAMCMC object with the arguments to run MCMC

Value

an a4aFit object if fit is "MP" or an a4aFitSA object if fit is "assessment"

Details

[REQUIRES REVISION] This method is the advanced method for stock assessment, it gives the user access to a set of arguments that the sca method doesn't. In particular, the default for the fit argument is 'assessment'. For detailed information about using the sca read the vignette 'The a4a Stock Assessment Modelling Framework' (vignette('sca')).

Examples

data(ple4)
data(ple4.index)

# fishing mortality by age and year (separable) AND catchability at age without year trend
fmodel <- ~factor(age) + factor(year)
qmodel <- list(~factor(age))
fit1 <-  sca(fmodel=fmodel, qmodel=qmodel, stock=ple4, indices=FLIndices(ple4.index))

# fishing mortality as a smoother by age and year (but still separable) AND
# catchability at age without year trend
fmodel <- ~ s(age, k=4) + s(year, k=10)
qmodel <- list(~factor(age))
fit2 <-  sca(fmodel=fmodel, qmodel=qmodel, stock=ple4, indices=FLIndices(ple4.index))

# fishing mortality as a smoother by age and year (but still separable) AND
# catchability as a smoother by age without year trend
fmodel <- ~ s(age, k=4) + s(year, k=10)
qmodel <- list(~s(age, k=4))
fit3 <-  sca(fmodel=fmodel, qmodel=qmodel, stock=ple4, indices=FLIndices(ple4.index))

# fishing mortality as a smoother by age and year (but still separable) AND
# catchability as a smoother by age with year trend
fmodel <- ~ s(age, k=4) + s(year, k=10)
qmodel <- list(~s(age, k=4) + year)
fit4 <-  sca(fmodel=fmodel, qmodel=qmodel, stock=ple4, indices=FLIndices(ple4.index))

# It's a statistical model
BIC(fit1, fit2, fit3, fit4)
#>       df      BIC
#> fit1 148 792.2708
#> fit2  91 662.5661
#> fit3  85 629.2156
#> fit4  86 471.2773

# fishing mortality as a smoother by age and year with interactions (i.e. non-separable) AND
# catchability as a smoother by age without year trend
fmodel <- ~ te(age, year, k=c(4, 10))
qmodel <- list(~s(age, k=4))
fit5 <-  sca(fmodel=fmodel, qmodel=qmodel, stock=ple4, indices=FLIndices(ple4.index))

# fit3 + smoother in recruitment
fmodel <- ~ s(age, k=4) + s(year, k=20)
qmodel <- list(~s(age, k=4))
rmodel <- ~s(year, k=20)
fit6 <-  sca(fmodel=fmodel, qmodel=qmodel, srmodel=rmodel, ple4, FLIndices(ple4.index))

# fit3 + bevholt
rmodel <- ~ bevholt(CV=0.05)
fit7 <-  sca(fmodel=fmodel, qmodel=qmodel, srmodel=rmodel, ple4, FLIndices(ple4.index))