Open-population generalized spatial mark-resight models using N-prior data augmentation, marginalization over latent individual identities, optional integrated telemetry data, and optional integrated trap random effects.
This repository extends the marginalized spatial mark-resight (SMR) models in Spatial-Mark-Resight-Marginal to open populations using the Jolly-Seber N-prior data augmentation framework in Jolly-Seber-N-Prior-DA. Here, I only consider the generalized SMR model (Whittington et al. 2018) which was introduced for closed populations to correct for spatially non-random sampling to deploy marks. This approach has also been termed "Spatial Capture Mark-Resight" by Efford and Hunter (2018), making the capture process explicit, which is probably better terminology. More recently a second modeling approach has been classified as generalized SMR (Whittington et al. 2025). This approach discards information in order to avoid modeling the marking process. In my opinion, this second approach does not meet the definition of generalized SMR stated in Whittington et al. (2018) that ties it to modeling the marking process. Regardless, here, I mean generalized SMR in the Whittington et al. (2018) context.
Basic MR models assume that the capture probability of marked and unmarked individuals are the same. In the context of SMR, this assumption requires that the spatial distribution of marked and unmarked animals across the state space are the same, which will not be true if, for example, individuals are targeted for marking disproportionately inside or around the resighting detector array. By modeling the marking process, we are modeling the process by which the marked and unmarked individuals come to have have different spatial distributions, which removes the bias induced when ignoring this process. A further implication of spatially non-random sampling is that covariates for density-habitat relationships will be estimated with bias. Moving to open populations, modeling the marking process is required to use telemetry survival states to inform survival parameters without introducing bias. Finally, the marking process contains valuable information about recruitment that is not present in the sighting data. For all these reasons, I do not consider open population SMR without the marking process data here.
Extending SMR to an open-population model also leads to a spatial integrated population model (IPM, Chandler and Clark 2014) that combines marked detections, unmarked detections, partially marked detections (e.g., marked with no ID samples), telemetry informed within and between year movement, telemetry survival data, or other data streams. Chandler and Clark (2014) introduced the spatial IPM with an example where primary sessions may contain completely marked or completely unmarked detection data--SCR and unmarked SCR primary occasions. In the open-population models I consider here, I allow any combination of marking and sighting observation processes across primary occasions, and consider that marks can be carried across primary occasions. One could do marking and resighting in only a subset of primary occasions and sighting only in the remainder, with the possibility of primary occasions with no observation process. Another option is that marking and sighting do not have to be in the same primary session, allowing demographic change between marking and sighting, which is not allowed in the closed population approach (Whittington et al. 2018).
There an many modeling approaches one might take for open-population SMR which will differ in MCMC efficiency and modeling flexibility. Here, I use the model in the Jolly-Seber-N-Prior-DA repository and the marginal SMR observation model for specific reasons. First, the Jolly-Seber model of Chandler and Clark (2014) has the desirable feature that the recruitment model is per capita as a function of realized abundance in the previous primary occasion. The per capita formulation makes a fixed recruitment parameter through time more ecologically realistic, and a single parameter is better identified and more efficiently estimated than using one recruitment parameter per primary occasion. Alternatively, a trend, other continuous relationship through time, or random effects are more ecologically realistic with a per capita parameterization. One could opt for per capita recruitment as a function of expected abundance, but the realized parameterization is arguably more ecologically realistic, and implies more demographic stochasticity.
While the Chandler and Clark (2014) model is ecologically realistic, it can be very slow to run due to the data augmentation design, particularly as the level of required population augmentation, M, increases. Further, the entry distributions are binomial approximations of Poisson distributions that are achieved only as M goes to infinity. Therefore, I opt to use the exact Poisson specification of this model in the Jolly-Seber-N-Prior-DA repository that also uses a more efficient MCMC algorithm to update the latent population entry and exit dates of each individual.
Second, I chose the marginal observation model because it mixes better than the conditional version where individual identities of latent identity samples must be updated in the MCMC algorithm. This is especially important for open populations where we are introducing many more latent variables that must be traversed along with the latent individual identities. One drawback of the typical marginal observation model approach used in BUGS-based software, though, is that updates of individual inclusion indicators and activity centers are very slow because the total expected detection rate for unidentified mark types are resummed across all individuals when updating these parameters for each single individual. We avoid this by using the approach of Herliansyah et al. (2024), section 4.3 inside the custom updates for individual inclusion indicators and activity centers. A second drawback is that we can only use the Poisson distribution for the sighting model.
The open-population formulation, including the population model, N-prior data augmentation, survival and recruitment processes, latent population-state histories, mobile activity-center models, and associated MCMC updates, is described in the Jolly-Seber repository.
The SMR observation model used here that allows for unknown marked status observations is from the closed-population marginalized SMR repository.
For a Poisson sighting model, latent individual identity can be marginalized analytically for the unidentified observation types. Individual identity therefore does not need to be sampled during MCMC, which improves mixing, especially for open-population models. For sighting observation models for which individual identity cannot be marginalized analytically, e.g. negative binomial, conditional open-population SMR models that explicitly sample latent individual IDs are available here:
An SCR implementation integrating telemetry survival and location data that allows mixing and matching 2 SCR observation models across primary periods (another spatial IPM) is available here:
The observation model contains separate marking and sighting processes. Individual identity is known in the marking data. During sighting occasions, individual identity and marked status may be fully observed, partially observed, or unknown.
For individual
where $\mathbf{s}{i,g}$ is the activity center of individual $i$, $\mathbf{x}{g,j}^{M}$ is the location of marking detector
where
The sighting process is generated in two stages. First, each individual generates a latent true number of sightings at each detector. Second, those sightings are classified according to whether individual identity and marked status are observed.
For individual
where
The latent true number of sightings is
where
Let
In the Interspersed versions, mark state is instead indexed by sighting occasion,
Thus, an individual can have
for all sighting occasions
For clarity, the observation-model and marginalization equations below are written using the standard, non-interspersed notation
For marked individuals, define
where the three elements are the probabilities that a sighting is recorded as marked with ID, marked with no ID, or unknown marked status.
For unmarked individuals, define
where
The first element is zero because an unmarked individual cannot generate an individually-identifiable observation. Conditional on the latent true count,
sightings are thinned into the observed sample types using a multinomial distribution. If individual
If individual
Thus, every true sighting is assigned to exactly one observed sample type. This is the conditional observation model used in the data-generating process and in the conditional SMR repository that updates latent individual IDs instead of marginalizing them out.
Because the latent true count is Poisson and the observed sample types are generated by multinomial thinning, the individual-level counts
in each sample type are independent Poisson random variables after marginalizing over
For a marked individual,
and
For an unmarked individual,
and
Marked-with-ID sightings retain individual identity and remain in the likelihood at the individual level. For the unidentified observation types, individual identity is not observed. Define the total underlying sighting intensity from marked individuals as
and from unmarked individuals as
For the interspersed models, these quantities are sighting-occasion specific,
and
Thus, the same individual can contribute to
The observed marked-with-no-ID count is
By the superposition property of independent Poisson random variables,
Similarly, the observed unmarked count is
with
Sightings with unknown marked status can arise from either marked or unmarked individuals,
giving
The marginalized likelihood therefore follows from two properties of the Poisson distribution:
- Poisson thinning: multinomial classification of a Poisson count produces independent Poisson counts for the resulting sample types.
- Poisson superposition: summing independent Poisson counts across latent individual identities produces another Poisson count with rate equal to the sum of the individual rates.
No other count distribution has both of these properties.
This model requires that the mark status of all individuals is known in every primary session, therefore, it is most directly
applicable to studies using telemetry collars for marks because one can typically know when the collar stops working and therefore
providing individual identity information. In the standard model versions, mark status is assumed constant within a
primary occasion. The Interspersed versions instead retain mark status at the secondary-occasion level, allowing mark status to change
within a primary occasion as individuals are captured and marked.
The interspersed approach is also required to account for any deaths that happen during resighting. While more flexible, the
interspersed version requires modeling the occasion dimension and therefore can be much slower, depending on the number of occasions.
One might choose to aggregate occasions to speed up run time at the cost of less accuracy of the mark states relative to sightings.
One feature that is not currently implemented here is that a dead GPS collar may only provide "marked with no ID" observation types. The proper way to account for this is to include a second marked state that represents "dead GPS collar", and estimate the probability of "marked with no ID" and "unknown marked status" observation types separately. There is an example of this in the marginal SMR repository for closed populations. Another approach that discards information is to treat these detection types as "unmarked", leaving no "marked with no ID" observation types.
Telemetry information can contribute to both survival and the spatial observation model.
Telemetry survival states provide direct information about the latent population state
Telemetry locations contribute to the spatial likelihood and inform activity centers and
The activity-center and movement models themselves are described in Jolly-Seber-N-Prior-DA.
Model versions containing TrapRE allow additional heterogeneity among detector × sighting-session combinations.
Let
using the shape-rate parameterization. Therefore,
and
Conditional on
under the mean-dispersion parameterization with
and
The implementation evaluates the ordinary marginalized Poisson likelihood for the individual sample types and adds the likelihood correction
induced by integrating over the shared detector random effect. As TrapRE.
The repository contains seven model versions. All use the same marginalized SMR observation model and open-population framework described above.
-
JS-SMR-Dcov Generalized
Generalized open-population marginalized SMR model with fixed activity centers. Marking and sighting effort can vary among primary occasions, including primary occasions with marking only, sighting only, both methods, or no observation effort. Mark status is constant within each primary occasion, and sighting observations are summed over secondary occasions before fitting the model.
-
JS-SMR-Dcov Generalized TrapRE
Version of model 1 with integrated detector random effects for the sighting process. A multiplicative gamma random effect is shared by all sighting types at a detector within a primary occasion and is integrated out analytically rather than sampled during MCMC.
-
JS-SMR-Dcov Generalized Interspersed
Modification of model 1 that allows marking and sighting occasions to be interspersed within a primary occasion. Mark status can therefore change during the primary occasion as individuals are captured and marked. Sighting observations and mark states are retained at the secondary-occasion level so that each sighting is modeled using the individual's mark status at that time.
-
JS-SMR-Dcov Generalized Interspersed TrapRE
Version of model 3 with integrated detector random effects for the sighting process.
The following models replace the fixed activity centers with the mobile activity-center model described in Jolly-Seber-N-Prior-DA.
-
JS-SMR-Dcov-mobileAC Generalized
Mobile activity-center version of model 1. Individuals have an activity center for each primary occasion, with movement among primary occasions modeled using the Gaussian movement and resource-selection model described in the Jolly-Seber repository. Mark status is constant within each primary occasion and sighting observations are summed over secondary occasions.
-
JS-SMR-Dcov-mobileAC Generalized TrapRE
Version of model 5 with integrated detector random effects for the sighting process.
-
JS-SMR-Dcov-mobileAC Generalized Interspersed
Mobile activity-center version of model 3. Activity centers can move among primary occasions, while marking and sighting occasions can be interspersed within primary occasions and mark status can change as individuals are marked.