Supplement 1. WinBUGS model specification for the lizard example in the paper.
lizard.txt -- WinBUGS model specification
The file lizard.txt contains the WinBUGS model specification of the spatial capture-recapture model for the lizard data analyzed in the paper. The coordinates of each individual's center of activity are given by the variables s1[i]and s2[i] which are assumed to be uniformly distributed over a box bounded by coordinates (Xl, Xu) (easting) and (Yl, Yu) (northing). These bounds are specified as inputs (i.e., data) to WinBUGS. The location of each individual at each sampling occasion are specified by the coordinate matrices U1 (easting) and U2 (northing) which are of dimension nind + nzeroes (size of augmented data list) × T (number of samples). The indicator variables flag1, flag2, flag3, and flag4 keep track of where each individual is at time t relative to the boundaries of the sample unit. Thus, inplot[i] is an indicator of whether individual i's activity center is within the sample unit.
The WinBUGS implementation of the model is based on data augmentation (Royle et al. 2007) in which a large number of all-zero encounter histories are added to the observed data (in the WinBUGS specification, this is the quantity nzeroes). Data augmentation induces a collection of latent indicator variables, z[i], indicating whether an individual in the augmented list is a member of the sampled population of size N. Data augmentation implies the model z[i] ~ dbern(psi) and psi ~ dunif(0,1). Together, these priors imply that N is discrete uniform on the integers 0-M where M = nind + nzeroes.
The following variables in the model specification are data that must be supplied by the user:
- Xl, Xu, Yl, Yu: define the edges of a square that contains the sample plot. This box defines the region over which individuals in the super-population of size M are distributed uniformly. It forms, essentially, a prior distribution for the activity centers.
- delta: this is the size (width) of the buffer -- the difference between the sample plot edge and the bounding box (for a square plot and larger square bounding box).
- nind: number of individuals encountered
- nzeroes: number of all-zero encounter histories added to the data set
- T: number of samples (surveys, replicates)
- Y: the 2-dimensional array of encounter histories including the augmented all-zero encounter histories.
- U1: the 2-dimensional matrix of easting coordinates of each individual. Non-captures are coded as missing values. This matrix includes the augmented all-zero encounter histories, coded as missing values.
- U2: the 2-dimensional matrix of northing coordinates of each individual. Non-captures are coded as missing values. This matrix includes the augmented all-zero encounter histories, coded as missing values.
The interested reader can consult the WinBUGS manual for formatting data for input into WinBUGS. The authors used the R library R2WinBUGS.
Royle, J. A., R. M. Dorazio, and W. A. Link. 2007. Analysis of multinomial models with unknown index using data augmentation. Journal of Computational and Graphical Statistics 16:67–85.