An open spatial capture–recapture model for estimating density, movement, and population dynamics from line‐transect surveys

Abstract The purpose of many wildlife population studies is to estimate density, movement, or demographic parameters. Linking these parameters to covariates, such as habitat features, provides additional ecological insight and can be used to make predictions for management purposes. Line‐transect surveys, combined with distance sampling methods, are often used to estimate density at discrete points in time, whereas capture–recapture methods are used to estimate movement and other demographic parameters. Recently, open population spatial capture–recapture models have been developed, which simultaneously estimate density and demographic parameters, but have been made available only for data collected from a fixed array of detectors and have not incorporated the effects of habitat covariates. We developed a spatial capture–recapture model that can be applied to line‐transect survey data by modeling detection probability in a manner analogous to distance sampling. We extend this model to a) estimate demographic parameters using an open population framework and b) model variation in density and space use as a function of habitat covariates. The model is illustrated using simulated data and aerial line‐transect survey data for North Atlantic right whales in the southeastern United States, which also demonstrates the ability to integrate data from multiple survey platforms and accommodate differences between strata or demographic groups. When individuals detected from line‐transect surveys can be uniquely identified, our model can be used to simultaneously make inference on factors that influence spatial and temporal variation in density, movement, and population dynamics.


| INTRODUC TI ON
Estimating population size is of primary interest in many ecological studies and is fundamental to assessing the status of wildlife populations. Estimates of local abundance or density (i.e., abundance per unit area) are also required to characterize the spatial distribution of a population and inform management decisions, such as configuring protection zones for endangered species and prioritizing sites for the eradication of invasive species (Taylor & Hastings, 2004;Udell et al., 2019). Likewise, an understanding of population dynamics and processes that influence temporal variation in abundance can be used to test ecological theory, inform the timing of management actions, and predict the outcome of alternative management strategies (Williams et al., 2002).
Line-transect sampling is commonly used to survey populations and, when combined with distance sampling methods, can provide estimates of abundance when detection is imperfect. In distance sampling, the distances to detected animals from a transect line are measured, and detection probability is modeled as a decreasing function of distance (Buckland et al., 2001). Distance sampling can also be applied in modeling spatial variation in density as a function of habitat covariates (Miller et al., 2013). However, the conventional distance sampling assumption that detection probability is 1 for animals located directly on the transect may not hold true for cryptic or aquatic species. Additionally, while repeated surveys can provide estimates of temporal trends in abundance (Moore & Barlow, 2011), distance sampling does not typically provide direct inference on underlying demographic parameters (e.g., recruitment, survival, movement) that drive changes in abundance over time and are often the target of management actions. Open population distance sampling models have been developed to assess population dynamics, but in practice they are generally limited to estimating population growth rate and not the underlying processes of recruitment and survival (Schmidt & Rattenbury, 2018;Sollmann et al., 2015). Similarly, in dynamic N-mixture models, which rely on replicated surveys to estimate abundance and demographic parameters of unmarked populations (Dail & Madsen, 2011), survival and recruitment are often confounded, resulting in less accurate estimates compared with capture-recapture studies (Zipkin et al., 2014).
Capture-recapture methods, in contrast, rely on the recapture of identifiable individuals over time and can provide estimates of abundance as well as demographic parameters for open populations (Williams et al., 2002). Spatial capture-recapture models extend these methods by incorporating the capture locations of individuals, which allows for inference on spatial variation in density and the ability to account for heterogeneity in detection probability due to the proximity of individuals to surveyed locations (Borchers & Marques, 2017;Royle et al., 2018). Most spatial capture-recapture models, however, have been developed for data collected from a fixed array of detectors (e.g., camera traps, hair snares), in which detections are restricted to discrete points in space (Gardner et al., 2010;Royle et al., 2013). Royle et al. (2011) presented a search-encounter spatial capturerecapture model to accommodate data collected along a survey path, including a set of line transects. This model allows detections to be anywhere in continuous space and, unlike other spatial capturerecapture and distance sampling models, includes an explicit model for individual movement. Borchers et al. (2015) illustrated that incorporating additional information about an individual's true location can improve inference in spatial capture-recapture models relative to when capture locations are restricted to the location of detectors.
In their formulation, Royle et al. (2011) discretized survey transects as a set of regularly spaced points and modeled detection probability as the cumulative hazard to detection over all points. However, the spacing of points chosen by the analyst results in a trade-off between long computation times (as when the survey path is represented as many points spaced closely together) and biased estimates of the effect of distance on detection probability (as when points are spaced far apart and detection distances are overestimated).
Here, we adapt the search-encounter spatial capture-recapture model using an approach that is analogous to distance sampling and can be applied to line-transect survey data. Specifically, we model detection probability as a function of the distance between an individual's location and the closest point on the closest survey transect, which should be more computationally efficient than the cumulative hazard approach (Kéry & Royle, 2020). This model is further extended to estimate demographic parameters (e.g., recruitment and survival, or immigration and emigration) using an open population framework, model variation in density across space and time, model movement as a function of habitat covariates, and accommodate differences between strata or groups. We illustrate this model using photo-identification data of North Atlantic right whales Eubalaena glacialis collected from aerial linetransect surveys in a migratory habitat to estimate density, arrival timing, and departure timing. As for many other endangered species, primary conservation measures for right whales include timearea restrictions on human activities, such as fishing and shipping (Crum et al., 2019;Farmer et al., 2016). Assessing the conservation value of such protection zones and quantifying the cumulative impact of external stressors requires spatially and temporally explicit estimates of absolute abundance, as well as estimates of residence time in an area (Pirotta et al., 2018). Using the right whale case study, we demonstrate how our model can provide these estimates while also providing insight on movement, resource selection, and the effectiveness of monitoring programs. We discuss the applicability to other taxa and further extensions of the model framework.

| Study design
The model can be applied to studies where transect lines are surveyed during T separate primary sampling periods. The population is considered open (to recruitment, deaths, and emigration) between each primary period. A robust sampling design (wherein multiple surveys are conducted within each primary period, during which the population is assumed closed; Pollock, 1982) is not required but is expected to improve precision of model estimates and allows inference on movement during primary periods. The number and configuration of transects may vary across sampling occasions, but the region of inference (i.e., state-space) is constant. The locations of transect lines (e.g., start and end points) surveyed on each sampling occasion are recorded. When individuals in the population are detected along a transect, their location is recorded and they are uniquely identified. An individual's location may be recorded with a GPS device or estimated from the sighting distance (e.g., using a rangefinder or inclinometer) and sighting angle. Methods for identifying individuals are varied but include artificial tags and branding (Smout et al., 2011), photo-identification via natural marks (Hammond, 2009), and genotyping using biopsy or noninvasive sampling (Constantine et al., 2012). Like other standard capturerecapture models, it is assumed that identifying marks are not lost or overlooked.
The model estimates the effects of habitat covariates on density and movement. Covariate values may vary between primary sampling periods, but they must be available or interpolated for the entire spatial extent of the state-space. A modified model without habitat covariates is easily implemented in our framework, but the increased availability of remote sensing and other geospatial data warrants their consideration.

| Open population model
To model population dynamics, we used an open population capturerecapture model, following a superpopulation formulation of the Jolly-Seber model (Schwarz & Arnason, 1996). This model estimates probabilities of recruitment to a population, , and of survival, , but in the right whale example, we interpreted as the probability of arriving in the study area and as the probability of persisting in the study area (Krzystan et al., 2018;Lyons et al., 2016). A Bayesian state-space formulation of this model was used to estimate the state variable z i,t , where z i,t = 1 if individual i was in the population (or study area) during primary sampling period t ∈ T and z i,t = 0 if it was not (Kéry & Schaub, 2012;Royle & Dorazio, 2009). To implement this model, we used data augmentation, which augments the number of observed individuals, n, with M − n hypothetical individuals and is equivalent to a discrete Uniform (0, M) prior for abundance at t = 1 (Royle & Dorazio, 2009).
Here, 1 is the proportion of M individuals that are in the popula- Thus, an individual in the population at t − 1 remains in the population through t with probability t−1 , and an individual not in the population at t − 1 may enter the population with probability t . Note that, here, t is conditioned on the number of M individuals that are available to be recruited (i.e., where z i,t−1 = 0; Gardner et al., 2010).
Unlike other formulations of the Jolly-Seber model in which an individual can be recruited only once, here an individual may enter (and leave) the population multiple times during the study, and the probabilities of re-entry are the same as those for initial entry; this can be modified to restrict individuals to a single entry (by tracking z i,1:t−1 ; Kéry & Schaub, 2012) or to allow probabilities of re-entry to differ from initial entry (by tracking z i,1:t−1 and including additional parameters). With this formulation, abundance (the number of individuals in the population) at time t, N t , is derived as and the number of recruits (individuals entering the population), R t , is derived as We constructed this model to accommodate a robust sampling design (Pollock, 1982), wherein data are collected for K t secondary sampling occasions within a primary sampling period t. The population is assumed closed to recruitment, mortality, and departure The logit function was used to constrain probabilities between 0 and 1, and time is the vector of primary period indices t = 1, 2, . . . , T standardized to mean = 0 and standard deviation = 1.

| Density model
In open spatial capture-recapture models, each individual in the population has a latent activity or home range center, s i,t , that is defined by its x-and y-coordinates in space and may vary across primary periods. Due to the high mobility of right whales, we assumed that their activity centers were independent across primary periods, but activity centers could alternatively be modeled to follow a random walk or to be constant across primary periods (Gardner et al., 2018).
For a given state-space region, S, the expected density of activity centers, D t = N t ∕area (S), is conventionally assumed to be constant (Royle et al., 2011). Here, however, we model the distribution of s i,t as a function of time-varying habitat covariates by discretizing the study area S into a grid of G pixels. Then, expected density in each grid pixel, E D g,t {g ϵ 1, 2, …, G}, varies across both space and time with a set of J covariates, X j , and s i,t is modeled as a categorical random variable, where Here, s i,t references a pixel defined by its center coordinates (Linden et al., 2018). The open population model specifies total abundance in each primary period, N t , while the density model specifies how those individuals are distributed across the study area; hence, there is no need for an intercept term in the density model, and E D g,t represents expected relative density. With a state-space formulation, realized absolute density, R D g,t , can be derived as the number of activity centers in pixel g at time t divided by the area of the pixel.
We defined the right whale state-space region as water between 0 m and 70 m deep, between 2,960 km and 3,740 km north (NAD83, UTM zone 17N), and west of 800 km east, discretized into 10 km × 10 km pixels for a total of G = 772 pixels ( Figure 1). Right whale density was modeled as a quadratic function of sea surface temperature (sst g,t ), wind speed (ws g,t ), and water depth (depth g ), F I G U R E 1 Study area for right whale analysis, discretized into 10 km × 10 km grid pixels, with survey transects and observed sightings from the 2009-2010 winter Sea surface temperature and water depth data were summarized following Gowan and Ortega-Ortiz (2014), and wind speed was summarized from the Cross-Calibrated Multi-Platform wind vector analysis product (Wentz et al., 2015). Sea surface temperature and wind speed values were averaged within each pixel and each primary period; water depth values were averaged within each pixel but were constant across time. Pixels with missing data were interpolated as the mean of neighboring pixels within 15 km, and each variable was standardized to mean = 0 and standard deviation = 1.

| Movement model
A movement, or space usage, model is used to model the probability, Movement,i,g,t , that individual i is in a given location (pixel g) on secondary sampling occasion k t ∈ K t . Following Royle et al. (2013), we modeled this movement probability as a function of d i,g,t (the distance between pixel g and s i,t ) and as a function of habitat covariates, Thus, if the movement scale parameter, move , is small, the inference is that individuals are less likely to move far from their activity centers. In contrast to standard spatial capture-recapture models, this movement model allows inference on resource selection functions (Royle et al., 2013), does not assume that space use is symmetric, and can be used to preclude estimated locations from occurring in unsuitable habitat (e.g., whales on land). In the right whale example, the habitat covariates and coefficients that influenced movement were the same as those that influenced density, and the discretized state-space for movement was the same as that for activity centers, but neither of these constraints is required (Linden et al., 2018).
Adapting the search-encounter model, we permit animals to be detected anywhere in continuous space. Accordingly, the pixel containing an individual's location on sampling occasion k t is and we assume a uniform prior for the individual's exact location within that square pixel, where side is the width of the pixel, and U xPixel,i,k,t and U yPixel,i,k,t are the x-and y-coordinates of the pixel's center.

| Detection model
Detection probability, p i,k,t , is a function of min l∈L dist i,k,t,l , the distance between the individual's location [U x,i,k,t , U y,i,k,t ] and the closest point on the closest survey transect out of L total transects on secondary sampling occasion k t . Distance between [U x,i,k,t , U y,i,k,t ] and a survey transect, l , is calculated as where [x l,1 , y l,1 ] is the westernmost point, [x l,2 , y l,2 ] is the easternmost point, m l is the slope, and b l is the y-intercept of survey transect l (Ballantine & Jerbert, 1952). We provide R code in the Supporting Information for calculating min (dist) when survey transects (or segments) are defined by the x-and y-coordinates of their start and end points and are assumed to follow a straight line. The detection function may take the form of those commonly used in distance sampling (Buckland et al., 2001). For example, in our application and following Gowan and Ortega-Ortiz (2014), we used a half-normal detection function if the closest survey transect was flown by a Twin Otter airplane, and we used a hazard-rate detection function if the closest survey transect was flown by a Skymaster airplane Note that, in distance sampling, p 0 (detection probability when min (dist) = 0) is conventionally assumed to be 1, whereas, in spatial capture-recapture models, it is an estimable parameter. The observation model is where y i,k,t = 1 if individual i was detected on secondary occasion k t and y i,k,t = 0 if individual i was not detected. The individual's location [U x,i,k,t , U y,i,k,t ] is observed and supplied as data to the model when y i,k,t = 1 but is latent when y i,k,t = 0. Figure 2 illustrates how the observation model is related to input data and state variables from the other model components.
Details for the aerial surveys and photo-identification data used in our right whale example are described elsewhere (Gowan & Ortega-Ortiz, 2014;Krzystan et al., 2018

| Group effects
When data are collected from different strata or groups, it is often desirable to combine the data into a single analysis in which some parameters are assumed constant across strata while other parameters vary. Such strata may be spatial or temporal replicates (Royle & Converse, 2014) or, as we illustrate, different demographic groups. This is relatively straightforward to implement by including the group index for V groups as a covariate for any component of the model. A key challenge with capture-recapture data is that group membership is not known for individuals that are not detected and it might not be known even for individuals that are detected (Genovart et al., 2012). To address this, we treat group i , the group index for individual i , as data when it is known and as a latent variable when it is unknown (including for all M − n individuals). We used a noninformative Dirichlet prior, specified with gamma hyperparameters (Kéry & Schaub, 2012), to model group index, a v ∼ Gamma (1, 1) .

F I G U R E 2
Diagram of model components, including observed data (boxes), latent state variables (circles), and estimated probability parameters (diamonds). The state variable z i,t , indicating whether individual i was in the population (or study area) during primary sampling period t, is influenced by probabilities of survival (or persistence), , and recruitment (or arrival), . Spatiotemporal covariates, X g,t , influence the density of activity centers, s, and an individual's location, U i,k,t , on secondary sampling occasion k. Detection probability, p, influences whether an individual is detected, y, and is determined by the distance between the individual's location and the nearest survey transect, l k,t In our application, we used V = 2 groups (calving females, all other demographic groups) and allowed arrival ( ), persistence ( ), movement scale ( move ), and baseline detection (p 0 , additive effect across survey platforms) to differ between these groups. Our a priori hypotheses were that calving females would arrive earlier and remain longer in the study area (Krzystan et al., 2018), move shorter distances, and spend more time near the surface (thus increasing their availability for detection) than the other group, but that the effects of habitat covariates on density and movement, and the effect of distance on detection, would be the same for both groups.

| Implementation
We fit the model using the R (version 3.6.0) package nimble (version 0 For the right whale application, the coordinate system was scaled (1 unit distance = 10 km) to aid model convergence. One sighting of a group of 5 individuals was deemed likely an uncoded verification sighting (min (dist) = 20.1 km, more than twice that of any other detection); this sighting was removed from the data to reduce its influence on the detection function (Buckland et al., 2001). Uniform priors were used for all arrival ( ), persistence ( ), density ( SST , WS , Depth ), movement ( move ), and detection (p 0 , hn , hr , b) parameters. The data-augmentation parameter M was initially set at 500 but was reduced to 350 after preliminary model runs suggested that it would reduce model runtime without affecting parameter estimates. We ran three MCMC chains of 12,000 iterations, discarding the first 6,000 as burn-in. We present the mean of the posterior distribution for each parameter, with 2.5% and 97.5% quantiles as 95% Bayesian credible intervals. We assessed chain convergence using the Gelman-Rubin statistic, R , and visual examination of the chains (Gelman et al., 2004). R values were <1.1, indicating convergence, for all parameters except the six habitat coefficients (R range: 1.1-2.1). Collinearity caused by including the squared values of each habitat covariate likely hindered convergence of these individual coefficients (Shacham & Brauner, 1997), but the functional relationships for each covariate were still estimated with reasonable precision, and simulations indicated that this artifact did not bias estimates of the functional relationships or other parameters.  Figure S3). Calving females were very likely to remain in the study area through at least early March, while other groups were more likely to depart ( Figure S4). For

F I G U R E 3
Estimated detection probability (with 95% credible intervals, dashed lines) as a function of distance for two survey platforms (Twin Otter and Skymaster aircraft) for calving female (top panel) and all other (bottom panel) right whales both groups, estimated abundance was highest in February ( Figure 5).
Realized absolute density estimates reflected an increasing number of whales in the study area from early December through late February, followed by decreasing density in March (Figures 5 and 6). Areas of highest density were located in the northern portion of the study area in the beginning of winter (when sea surface temperatures were highest), shifted south in the middle of the winter (when temperatures were lowest), and then shifted back north at the end of the winter ( Figure 6).

| D ISCUSS I ON
Most abundance models for line-transect surveys are designed to estimate abundance within an area at discrete points in time.
However, the open spatial capture-recapture model presented here permits inference on factors that influence spatial and temporal variation in density, movement, and population dynamics within a single framework. This model offers several advantages over other methods for estimating abundance. For example, in conventional distance sampling, p 0 is assumed to be 1, or an ad hoc correction factor is used based on ancillary information, such as diving behavior for aquatic species (Roberts et al., 2016). In contrast, the model presented here estimates p 0 directly using information from the recapture of identified individuals, similar to capture-recapture distance sampling that relies on multiple observers (Borchers et al., 1998).
In our case study, we estimated variation in p 0 due to behavioral differences across demographic groups as well as survey platform configurations ( Figure 3). Moreover, because individuals are tracked across survey occasions, our model provides improved inference on F I G U R E 4 Expected relative right whale density (with 95% credible intervals, dashed lines) as a function of sea surface temperature (SST), wind speed, and water depth. In each panel, the other two covariates are held constant at their mean value F I G U R E 5 Estimated abundance (circles; with 95% credible intervals) and observed number of individuals (open triangles; i.e., uncorrected count) by primary period for calving female and all other right whales population processes such as recruitment, mortality, and residency that drive temporal variation in abundance. We believe this aspect can be particularly useful in quantifying cumulative impacts based on the amount of time an individual is exposed to stressors in an area (Pirotta et al., 2018). For example, we estimated that most calving female right whales were present in the study area from at least early January through March, indicating that they are exposed to threats such as ship traffic and noise impacts in this region throughout the entire winter.
In contrast to conventional capture-recapture methods, the area of inference is explicitly defined in spatial capture-recapture models (Borchers & Marques, 2017). This distinction may be especially important when there are changes over time in the survey extent or spatial patterns of abundance (e.g., due to movement of mobile species). Additionally, variation in density across space can be inferred and used to inform management decisions, such as the placement of protection zones (Udell et al., 2019) and the design of future monitoring surveys. Modeling heterogeneity in the spatial distribution of individual activity centers and movements allowed us to account for the effect of proximity to survey transects on an individual's detection probability. Ignoring this heterogeneity in detection probabilities is known to bias abundance estimates in both conventional and spatial capture-recapture models (Royle et al., 2013). Finally, while most spatial capture-recapture models have been developed for detectors arranged in a fixed array, our model can be applied to data collected from continuous line transects, without the need to approximate those lines as points.
Our case study was limited to only a portion of the North Atlantic right whale's range, but the results are relevant to understanding reproduction (via the number of calving females) and migration patterns, as well as to quantifying risk from human activities in the area. For example, frameworks used to predict ship-strike mortality risk for whales require accurate estimates of whale density and residency as inputs (Crum et al., 2019;van der Hoop et al., 2012).
Estimated patterns of right whale spatial distribution and residency in this study were consistent with previous work in the region (Gowan & Ortega-Ortiz, 2014;Krzystan et al., 2018;Roberts et al., 2016), but our model integrates these components in a single analysis that provides estimates of absolute density while relaxing assumptions about p 0 . Additionally, our framework includes an explicit model for individual movement, which highlighted the large scale of right whale movements and the importance of accounting for environmental factors. Unlike most spatial capture-recapture models, which implicitly assume that space use within an individual's home range is symmetric and stationary (e.g., Royle et al., 2011), we modeled space use as a function of habitat covariates, which will be more appropriate for species that seek patchily distributed resources (Curtice et al., 2015;Royle et al., 2013).
Right whale survey data from additional winters could be included within the same framework to examine interannual variation in migration dynamics and density, while assuming that some parameters related to detection and movement may be constant across years. Multiple years of data could be estimated jointly in a single analysis or in a sequential manner using posterior estimates from F I G U R E 6 Estimated density (i.e., abundance in 10 km × 10 km grid pixels) of right whales by primary period previous seasons as priors. The methodology can also be applied to right whale surveys in other regions that use photo-identification and record the locations of sightings and survey transects, with the potential for estimating density throughout the species' range and population dynamics across years. However, different habitat covariates are likely needed to model density in different regions (e.g., calving grounds versus feeding grounds), and using such covariates to extrapolate density to areas with sparse survey effort should be done cautiously (Wenger & Olden, 2012).
We believe there is great potential to apply our spatial capturerecapture model, or modifications thereof, to other monitoring programs, but we acknowledge the trade-off between survey costs and level of inference gained. For example, the identification of individuals typically results in increased survey time or costs, although numerous methods for doing so exist (Hammond, 2009), and it is expected to provide increased information about p 0 and population dynamics. Beyond visual and genetic identification methods, the application of spatial capture-recapture models for passive acoustic data has received some attention (Marques et al., 2012), but challenges associated with identifying individuals from vocalizations and accounting for nonvocalizing individuals remain . If detection distances are not available, alternative detection models can be used (e.g., Russell et al., 2012) (Bischof et al., 2020). Future work should consider explicitly modeling grouping behavior and an observation process where both groups and individuals within a detected group may go undetected (Clement et al., 2017). Additionally, we assumed that detection and movement parameters were constant throughout the winter, yet calving females typically do not give birth until sometime after they arrive in the study area. A multistate model could be developed to account for behavioral differences between pregnant females and females with a calf. Moreover, some individuals that we classified into the other group may have in fact been calving females whose calves were never detected, so group index could be regarded as an unknown parameter even for individuals that are detected.
Including activity center, s i , as a latent variable is a primary component of all spatial capture-recapture models. However, estimates for move were relatively large in our case study, indicating that whales had limited fidelity to these estimated activity centers. Rather than estimating s i , an alternative approach might estimate an individual's location when it is first recruited (either with a uniform prior or as a function of habitat covariates), then extend our movement model to estimate subsequent locations with a correlated random walk. In this scenario, d i,g,t would refer to the distance from an individual's previous location rather than its activity center, and inferences on density would relate to an individual's true location on each occasion rather than to a stationary activity center. This approach may be more relevant for highly mobile species with limited site fidelity, and it may be useful in distinguishing true mortality from dispersal from the survey area (Schaub & Royle, 2014). In any case, available telemetry data can be integrated to inform movement parameters and improve resulting estimates of density (Royle et al., 2013).
Modifying our model based on study species, parameters of interest, and available data is relatively straightforward due to the availability of software for specifying customized Bayesian models (de Valpine et al., 2017). However, model runtimes using MCMC can be prohibitive in some situations, so we encourage the development of maximum-likelihood approaches (Glennie et al., 2019) and other solutions to improve computational efficiency while retaining ease of customization. Such developments should make open spatial capture-recapture models more accessible and amenable to model selection in order to improve inferences on abundance, space use, and population dynamics from monitoring data.

ACK N OWLED G M ENTS
We thank the aerial survey teams (Clearwater Marine Aquarium Save the Manatee Trust Fund.

CO N FLI C T O F I NTE R E S T
The authors have no conflicts of interest to declare.

DATA AVA I L A B I L I T Y S TAT E M E N T
The data used for the right whale analysis are available on the Dryad