Model Building

The model construction is served in E-SURGE by two modules called GEPAT (GEnerator of PATtern of elementary matrices) and GEMACO (Generator of Matrices of COnstraints) (Choquet 2008). In GEPAT, you specify the structure of the vector of initial state probabilities, the matrix of transitions governing the state process and the matrix of observations (conditional on the states) governing the observation process. To specify a parameter that will be estimated (i.e., that will be assigned an effect in GEMACO, see below), you can use any letter. The minus sign ‘-’ means that the parameter corresponding to this cell will always be set to 0 while the star ‘*’ means the complementary of the sum of all the other parameters on the same row. This GEPAT step is very useful as it deactivates the relevant matrix elements once and for all without having to fix values every time a model is fitted.

Note that in the vector of initial state probabilities, which corresponds in the capture-recapture context to the state of individual at first encounter, the ‘dead’ state is always removed as individuals are all alive when marked. In the transition and observation matrices, this state is present and needs to be accounted for.

Of practical interest, the three elements of a HMM can be specified through a multistep process that proves very useful in accommodating state uncertainty for example (eqn. 5). After entering the size of the matrix, the default matrix options (diagonal, full or empty matrix) can be used as a starting point to specify a matrix.

In GEMACO, we specify the effects (sensu the design matrix in programs MARK and PRESENCE) using a R-like syntax: for example, a season effect will be specified by ‘t’ for time, a group effect by ‘g’ while a constant effect will be ‘i’ for intercept. If the effect of a site covariate needs to be investigated, we use ‘i + xind’ where xind specifies the slope of the relationship. The matrices defined at the GEPAT step can be manipulated using the syntax ‘from’ for rows and ‘to’ for columns. For example, f(1).to(2) will pick the element in row 1 and column 2 of the corresponding matrix, and if a time effect is required on this element, then the syntax will be f(1).to(2).t. If the entire first row of a matrix with five columns needs to be selected, then we use f(1).to(1,2,3,4,5). A colon ‘:’ is useful to lump categories together while the ampersand symbol ‘&’ aggregates parameters corresponding to levels of different factors. Additive and interactive effects can be specified with the plus sign ‘+’ and dot ‘.’ respectively.

Shortcuts can be defined to assign a name to a given syntax, hence simplifying the formulas in GEMACO.

Choquet, R. (2008) Automatic generation of multistate capture recapture models. The Canadian Journal of Statistics, 36, 43–57.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License