build: Format data for model fitting

Description Usage Arguments Value

View source: R/build.R

Description

Format data for model fitting

Usage

1
2
3
4
5
build(survey1, survey2, survey3, paa.catch.female, paa.catch.male,
  n.trips.paa.catch, paa.survey1.female, paa.survey1.male, n.trips.paa.survey1,
  catch, paa.mature, weight.female, weight.male, misc.fixed.param = NULL,
  theta.ini = NULL, lkhd.paa = "normal", var.paa.add = TRUE,
  enable.priors = TRUE)

Arguments

survey1

matrix (or data frame) of biomass estimates from survey 1 (g = 2); each row corresponds to a year of available data, the first column reports the year (T_2), the second column is the survey biomass estimate I t,2 , and the third column is the observation error SD values κ t,2, for t ∈ T_2.

survey2

matrix (or data frame) of biomass estimates from survey 2 (g = 3); each row corresponds to a year of available data, the first column reports the year (T_3), the second column is the survey biomass estimate I t,3 , and the third column is the observation error SD values κ t,3, for t ∈ T_3.

survey3

matrix (or data frame) of biomass estimates from survey 1 (g = 4); each row corresponds to a year of available data, the first column reports the year (T_4), the second column is the survey biomass estimate I t,4 , and the third column is the observation error SD values κ t,4, for t ∈ T_4.

paa.catch.female

matrix (or data frame) of paa for the females (s = 1) from the commercial catch (g = 1); each row corresponds to a year of available data, the first column reports the year (U_1) and the next 30 columns correspond to the paa per age class and year p a,t,1,1 , for t ∈ U_1.

paa.catch.male

matrix (or data frame) of paa for the males (s = 2) from the commercial catch (g = 1); each row corresponds to a year of available data, the first column is the year (U_1) and the next 30 columns correspond to the paa per age class and year p a,t,1,2 , for t ∈ U 1.

n.trips.paa.catch

matrix (or data frame) of the number of trips per year of available paa for the commercial catch (g = 1); each row corresponds to a year, the first column reports the year (U_1), the second column is the number of trips n t,1 , for t ∈ U_1.

paa.survey1.female

matrix (or data frame) of paa for the females (s = 1) from survey 1 (g = 2); each row corresponds to a year of available data, the first column reports the year (U_2) and the next 30 columns correspond to the paa per age class and year p a,t,2,1 , for t ∈ U_2.

paa.survey1.male

matrix (or data frame) of paa for the males (s = 2) from survey 1 (g = 2); each row corresponds to a year of available data, the first column is the year (U_2) and the next 30 columns correspond to the paa per age class and year p a,t,2,2 , for t ∈ U_2.

n.trips.paa.survey1

matrix (or data frame) of the number of trips per year of available paa for survey 1 (g = 2); each row corresponds to a year, the first column reports the year (U_2), the second column is the number of trips n t,2 , for t ∈ U 2.

catch

matrix (or data frame) of commercial catch (g = 1); each row corresponds to a year of available data, the first column reports the year (T_1, i.e the whole range 1940–2012), the second column is the catch C_t.

paa.mature

vector of A = 30 proportions of mature females.

weight.female

vectors of A = 30 average weight at age of females (s = 1).

weight.male

vectors of A = 30 average weight at age of males (s = 2).

misc.fixed.param

optional named vector/list (or data frame) of fixed values for the selectivity parameters of surveys 2 and 3 and for the process error SD σ R ; the names must match muS2, deltaS2, upsilonS2, muS3, deltaS3, upsilonS3 and sigmaR. If unused (left to NULL), then the following default values are used: muS2 = muS3 = 13.3, deltaS2 = deltaS3 = 0.22, upsilonS2 = upsilonS3 = 10 and sigmaR = 0.05.

theta.ini

optional named vector/list (or data frame) of starting values for the model parameters to be estimated; the names must match R0, M1, M2, muC, deltaC, upsilonC, muS1, deltaS1, upsilonS1, h, qS1, qS2 and qS3. If unused (left to NULL), then the default values given in Table 2 are used.

lkhd.paa

either "normal" or "binomial"; specifies a binomial likelihood for the paa, following Cadigan et al. (2014), which may be more statistically sound (and simpler) or a Gaussian likelihood as originally specified in Edwards et al. (2014). Defaults to "normal".

var.paa.add

either TRUE or FALSE; if TRUE (the default), it enables the addition of the 1/(10A) term in Varξ a,t,g,s related to the Gaussian observation error of (F.19 ? ). If FALSE, this additional term is 0 (disabled). If some observed p a,t,g,s are exactly 0 or 1, as in the POP data, then it must be set to TRUE to avoid zero variances with lkhd.paa = "normal".

enable.priors

either TRUE or FALSE; if TRUE (the default), it enables all the prior distributions defined in Section 3.1. If FALSE, the priors are disabled and the maximization over θ is carried without any constraints (apart from constraints on their range of possible values enforced by means of transformations, such as strictly positive variances).

Value

A list of class obj properly formatted to be fed to fit(), with the following elements:


pbs-assess/tmbpop documentation built on Nov. 5, 2019, 12:16 a.m.