**Appendix S1.** Statistical properties of the abundance‐weighted average estimator for center of gravity.

**Appendix S2.** Calculating center of gravity, population boundaries, the population kernel, and area occupied for the species distribution function model.

**Appendix S3.** Detailed description of methods for the spatiotemporal species distribution function model.

**Appendix S4.** Details regarding a simulation experiment evaluating the likely performance of AWA and SDF estimators.

**Appendix S5.** Visualizing the spatial distribution of sampling for triennial and annual surveys.

**Appendix S6.** Changes in the northern and southern population boundary for West Coast fishes.

Climate change and variability have already impacted the spatial distribution of many different taxa including butterflies (Parmesan *et al*. ), plants (Kelly & Goulden ), bees (Kerr *et al*. ), birds (Hitch & Leberg ) and marine fishes (Pinsky *et al*. ). Climate impacts have often been identified via changes in spatial distribution, due to the wide availability of spatially referenced survey data for many taxa as well as the relative ease of detecting changes in population distribution over time. Changes in distribution can have immediate relevance to local economies and international diplomacy (Cheung *et al*. ), as well as species interactions and evolutionary trajectories (Garroway *et al*. ). Climate change has also been documented to affect many biological processes, including the allocation of energy between growth and reproduction, community composition and phenology (Parmesan ).

Estimating directional changes in a spatial distribution is not unique to population biology – similar problems exist in quantifying distributional changes in sea ice, temperature, rainfall and patterns of disease in response to climate change. In all of these problems, it can be difficult to distinguish between long‐term (multidecadal) trends caused by anthropogenic climate change, interdecadal variability and short‐term fluctuations in spatial distribution. As a result, identifying trends in spatial distribution due to climate change generally requires analysing data from decadal or longer time‐scales (Hitch & Leberg ). Long time series regarding species distribution are rare (Parmesan *et al*. ), and much could be learned if shorter time series could be stitched together. However, combining data from multiple sampling protocols poses serious difficulties, including quantifying the relative performance of survey efficiency among different survey teams or sampling protocols (Sauer, Peterjohn & Link ), accounting for spatial differences in sampling intensity and estimating the uncertainty in any resulting estimate of distribution. Even within a long‐running survey, such as the North American Breeding Bird Survey, volunteer skill and training, sampling design, and sampling effort may vary regionally and over time. For example, sampling sites may be added or removed in any given year, sampling effort may go up or down at particular sites, or the sample design itself may include random site selection (e.g. a stratified random design). Authors have tried to deal with these complications by trimming survey data to only consistently surveyed sites and time periods with consistent survey methods (Pinsky *et al*. ) or by stratifying the survey area (Rindorf & Lewy ; Dulvy *et al*. ; Engelhard, Righton & Pinnegar ). The former is often unsatisfactory because it requires discarding data. The latter estimator will eliminate the bias arising from changes in survey sampling intensity given that each stratum is sufficiently small, but will also lose precision in this case unless the average within each stratum is calculated using a shrinkage estimator (i.e. by borrowing information from nearby strata).

In this study, we compare conventional approaches to quantifying changes in species distribution to a new model‐based estimator. We first show that the conventional ‘abundance‐weighted average (AWA)’ estimator for the centre of a species distribution (termed the ‘centre of gravity’, COG) confounds true changes in species distribution with changes in the distribution of sampling effort. The conventional approach also does not estimate a standard error for distribution metrics and therefore cannot distinguish between sampling variation and significant interannual variability. We then show how to estimate COG, area occupied and population range using any model that estimates a species distribution function (SDF). SDFs are estimated by a wide class of models including, for example occupancy models and presence‐only models. The SDF approach to estimating distribution shifts can account for shifts in sampling effort over time (or concentrations of effort in particular combinations of years and areas), separating the observation process from the true underlying spatial distribution, and hence account for changes in survey methods or locations when combining data from multiple sampling programmes. The SDF approach also estimates standard errors that can be used to distinguish whether interannual variation in distribution is biologically important or an artefact of limited sampling data. In this study, we apply the SDF estimator to data for 18 bottom‐associated fishes off the U.S. West Coast, integrating data across two survey programmes (1977–2004 and 2003–2013). Using the SDF model, this case study illustrates that six species show a statistically significant, northward shift in distribution from 1977 to 2013, while only two show a significant southward shift. All code for replicating this analysis (as well as example data for surveys of marine fishes in the California Current, Gulf of Alaska, Eastern Bering Sea and South Africa) is publicly available (

A wide range of metrics have been used or proposed for understanding shifts in species distributions, including the COG, location of population boundaries, the area occupied, the mean temperature of occurrence or the thermal preferences of species in a local community (Perry *et al*. ; Devictor *et al*. ). Below, we describe some of the conventional estimators as well as a novel SDF approach from which a wide range of metrics can be estimated.

Conventional estimators use available data on the location of species occurrences (and often abundance as well), often processed so as to attempt to ensure comparability through time. For example, the AWA estimator has been widely used to track changes in the COG of a population's distribution (Perry *et al*. ; Kelly & Goulden ; Pinsky *et al*. ; Hiddink, Burrows & García Molinos ). This estimator calculates the COG as the average location of samples in a given year, where each location is weighted by the abundance (measured either as numbers or biomass) of the species encountered at that location. This estimator can be applied in multiple dimensions (e.g. latitude and longitude), but as one example the latitudinal COG, *n* is the number of available samples, *c*_{i} is the abundance of the species in the *i*th sample, and Latitude_{i} is the latitude of the *i*th sample. This estimator confounds changes in the spatial distribution of sampling with range shifts for sampled species (see Appendix S1, Supporting information) and therefore is only suitable when the distribution of sampling is constant over time. Conventional methods for calculating standard errors (e.g. sample variance computations or nonparametric bootstrapping) are not appropriate for this estimator because residuals are likely autocorrelated. The inability to estimate standard errors complicates efforts to distinguish between random variation in the estimator and either interannual or multiyear trends in COG. Inferring multiyear trends from the AWA estimator is generally done by estimating the COG in each time period, then fitting a linear regression model to estimate temporal trends. Significant trends in COG are identified using a Wald test given the null hypothesis that the trend coefficient is equal to zero.

The same data can also be used to estimate other metrics for changes in distribution. While population boundaries are difficult to observe because species detectability can decline as a species become rarer, estimators for population boundaries include the absolute highest and lowest latitudes at which a species is observed or an average of the three highest or lowest latitudes (Perry *et al*. ). Similarly, area occupied can be computed as the minimum number of grid cells that contain 90% of species abundance in each year (Fisher & Frank ). Similar to the AWA estimate of COG, these metrics lack a well‐defined standard error. Trends over time are often detected with a linear regression model.

As an alternative to the conventional sample‐based methods, we propose a model‐based estimator for analysing shifts in distribution. The model‐based approach begins by defining a SDF *d*, where the value of this function *d*(*s*) at any given location *s* describes the expected density of the population within a spatial domain *s* within a given spatial domain. We advocate estimating model parameters, predicting density

The predicted SDF *n*_{s} is the number of locations (e.g. grid cells) used to summarize a spatial domain, *s*_{i}, and Latitude (*s*_{i}) is latitude for this location. This calculation (eqn ) resembles the AWA approach (eqn ), except replacing a weighted average of sample locations with a weighted average of predictive locations. To calculate population boundaries, we calculate the cumulative distribution for abundance in northings and eastings, and then identify the 5th and 95th percentiles of this cumulative distribution. For area occupied, we first estimate a population kernel that summarizes the distribution of the species (Woillez, Rivoirard & Petitgas ) and then calculate the volume of this kernel.

This model‐based estimator provides several benefits relative to conventional estimators like AWA:

A model‐based approach to estimating shifts in distribution has been used in previous ecological studies (Elith, Kearney & Phillips ; Matthews *et al*. ), although these have generally used habitat envelope modelling (i.e. predicting density as a function of measured habitat variables) rather than by estimating spatially correlated latent variables (as we do in our case study example). Previous research suggests that including spatial autocorrelation will improve predictions of species density compared with using only measured habitat variables (Bahn & McGill ; Shelton *et al*. ), so we hypothesize that incorporating spatial autocorrelation will also improve our estimates of range shifts relative to habitat envelope approaches.

For our case study application, we estimate the species density function *d*(*s, t*) for multiple time intervals, *T* is the number of modelled intervals. We use a conventional ‘delta model’ [also known as a ‘hurdle’ model (Martin *et al*. )] which decomposes density *d*(*s, t*) into two components: (i) the probability *p*(*s, t*) of encountering the species at a given location and time and (ii) the expected density *r*(*s, t*) of the species when encountered:

We specify that each of these processes follows a first‐order random walk process (Cressie & Wikle ), that is encounter probability *p*(*s, t*) and expected density when encountered *r*(*s, t*) in year *t* depend only upon their value the year before (*p*(*s, t*−1) and *r*(*s, t*−1)) and the spatial distribution of the population is otherwise independent among years (see Thorson *et al*. 2015b and Appendix S3 for further details).

We next specify a distribution for sampling data, that is the probability that the *i*th survey sample is positive (i.e. that the species is encountered) is affected by encounter probability *p*(*s*_{i}, *t*_{i}) at the location *s*_{i} and year *t*_{i} for sample *i*, as well as additional ‘catchability’ variables *r*(*s*_{i}, *t*_{i}) as well as catchability variables *d*(*s*, *t*) is calculated for a reference value of these variables,

Parameters governing the stochastic process *p*(*s, t*) and *r*(*s, t*) are estimated using survey data from multiple survey designs. In the following, we assume that sampling in each year follows a probability sampling design, that is that there exists some stochastic process *s*, *t*) is the probability that location *s* will be sampled in time *t*. We further assume that this sampling process is statistically independent of population density *d*(*s, t*). This assumption is appropriate given that the sampling follows a pre‐determined protocol which was designed independently from dynamics for any single species. However, the assumption would be invalid in other instances, for example if we used data from a fishery targeting a particular species. Given these two assumptions, we can estimate fixed effects by maximizing the marginal likelihood of the data without explicitly estimating the sampling process *et al*. ). In the following, we treat as fixed the coefficients for measured variables, the magnitude of spatiotemporal variation, the spatial scale for encounter probability and positive densities, the catchability coefficients and the residual variance of positive catch rates (see Appendix S3 for further details regarding parameters). We treat the spatiotemporal variation as random effects and approximate the probability of these random effects using a stochastic partial differential equation approximation (Lindgren, Rue & Lindström ; Thorson *et al*. ).

To estimate parameters, we maximize the marginal likelihood with respect to fixed effects. We approximate the marginal likelihood of fixed effects while integrating across random effects via the Laplace approximation using the Template Model Builder (TMB) software (Kristensen ; Kristensen *et al*. in press). Estimating the SDF model using TMB involves five steps: (i) we specify the joint likelihood of data and random effects in a template file; (ii) for a proposed set of fixed effects, TMB identifies values of random effects that maximizes the joint likelihood; (iii) given these values for fixed and random effects, TMB calculates the second derivatives of the joint likelihood with respect to random effects and calculates the Laplace approximation to the marginal likelihood; (iv) TMB calculates the gradient of the Laplace approximation to the marginal likelihood with respect to fixed effects; and (v) we use the marginal likelihood and its gradients via a conventional nonlinear minimizer in the

As a case study, we analyse two different survey data sets spanning 1977–2013 in the west coast of the USA. These surveys are designed to monitor changes in the biomass of fish populations that are targeted by commercial and recreational fisheries of the U.S. West Coast. The first survey (subsequently called the ‘triennial survey’) was operated by the Alaska Fisheries Science Center every third year from 1977 to 2004 (for a total of 10 survey years), with an average of 484 samples per year (Weinberg *et al*. ). The second survey (subsequently called the ‘annual survey’) was operated by the Northwest Fisheries Science Center every year 2003–2013 (for a total of 11 survey years) and has on average 629 samples per year (Bradburn, Keller & Horness ). Triennial and annual surveys also use different vessels and sampling gear, and these differences are likely to cause differences in sampling efficiency between surveys. Pinsky *et al*. () previously analysed range shifts using the AWA estimator applied to data from the triennial survey, but did not incorporate data from the annual survey due to concerns about changes in survey methods. We here demonstrate the implications of analysing data from both surveys using the conventional or SDF estimators. This demonstration serves two purposes:

*et al*. () analysis when incorporating data from an additional 11 years of data (i.e. the 2003–2013 period in the annual survey).

We restrict our analysis to tows that occur within the spatial domain of both surveys, and this decreases sample sizes available for each survey (triennial: 434; annual: 412 samples per year on average). We use this restriction for both SDF and AWA estimators (although it is not necessary for the SDF estimator) to ensure that results are comparable between methods. For the AWA analysis, we fit separate linear regressions to the triennial and the annual survey data, reflecting their substantially different locations and methods.

The spatial sampling intensity function differs between the two survey designs even within the restricted area that is within the spatial domain of both surveys, and spatial sampling intensity also varies among years within a given sampling design. The two surveys also differ in seasonal timing and likely differ in terms of sampling efficiency (a.k.a. catchability, i.e. the proportion of fish captured that are located within the sampled area). In the SDF analysis, we therefore include the following catchability variables:

*j*_{i} for each sample; and*v*_{i} for survey (where *v*_{i}* = *1 if the sample is from the triennial survey and zero otherwise)

such that catchability variable *z*_{p}(*i*)* = z*_{r}(*i*)* = *(*j*_{i}*, v*_{i})^{T} for sample *i*. These two variables (*j* and *v*) represent linear offsets of encounter probabilities (in logit space) and positive catch rates (in log space). Both variables have sufficient contrast to be estimated with a low standard error, that is Julian calendar date has broad overlap among surveys (Fig. ) and both annual and triennial surveys were conducted in 2004. Including these catchability covariates, while not including them when predicting density for calculating COG, ‘filters out’ the variation that is attributable to calendar date or survey design, and species distributions and COG are then predicted for a standard date (July 31st) and the triennial survey. We do not include any variables *a priori* as predictors of spatial variation in density (i.e. *x*(*s*) is not included in the model) and therefore account for all spatiotemporal variation via the random walk process (ε_{p}(*s, t*) and ε_{r}(*s, t*)*,* see Appendix S3). While future studies could explore oceanographic or habitat predictors of species distribution using the SDF model (Shelton *et al*. ), we do not do so to ensure that results are strictly comparable to the AWA estimator (which does not typically incorporate predictor variables).

For computational reasons, we approximate spatiotemporal variation (ε(*s, t*)) as being piecewise constant at a fine spatial scale. We do this by estimating functions at *n*_{x}* = *500 *‘*knots’, which are selected via a *k*‐means clustering algorithm applied to location of sampling data. Each location *s* within the survey domain then has function value ε(*s*_{x}*, t*) where *s*_{x} is the location of the knot *x* that is closest to location *s*. We confirm that results are qualitatively similar when increasing the number of knots (i.e. *n*_{x}* = *1000). We then compare estimates of the change in distribution between AWA and SDF estimators to examine whether these two methods generate different inference regarding distribution shifts in this region.

We also conduct a simulation experiment to illustrate the magnitude of bias that arises from using either the AWA or SDF estimators given the timing and location of samples that are available. In this experiment, we simulate population density *d*(*s, t*) = *p*(*s, t*)*r*(*s, t*) in each of 15 979 grid cells (each is 2 × 2 nautical miles) that are included in the domain of the surveys in our analysis. We simulate density under four scenarios, representing (i) constant, (ii) highly variable, (iii) northward shifts or (iv) southward shifts in population COG (Appendix S4 for details). We then simulate sampling that occurs in the same years and at the same locations as in the annual and triennial surveys. We analyse the simulated data using the AWA and SDF estimators and compare the estimate of northward COG with its true value.

Examination of the average latitude and longitude of survey samples in each year (Fig. ) illustrates the magnitude of spatial changes in sampling intensity over time. In particular, the median latitude of samples was nearly 45°N in 1986, but was close to 40°N from 2005 to 2012. The distribution of the triennial survey varied greatly during the 1980s and did not sample far south of the San Francisco Bay in 1980, 1983 and 1986 (Appendix S5). Therefore, even a population that was uniformly distributed throughout this survey domain would appear to move south from the 1980s (during the early triennial sampling period) to the 2000s (during the annual sampling period).

Results from our simulation confirm that the SDF estimator greatly mitigates the bias seen in the AWA estimator (Fig. ). In particular, the AWA estimator is positively biased in all scenarios from 1977 to 2003 (i.e. during the triennial survey sampling period). This positive bias is greatest in years when the triennial survey had sampling distributed in more northerly areas (i.e. 1980, 1983, 1986). The bias is negligible for both estimators during the annual sampling period (2003–2013), and the SDF estimator has a small positive bias during early years for the ‘northward shift’ scenario and a small negative bias for the ‘southward shift’ scenario. Exploratory analysis indicates that the SDF estimator smooths density estimates for the unsampled, southward portion of the population domain for early years (1980, 1983 and 1986) towards the estimated distribution in 1989. Decreased bias using the SDF estimator is particularly evident for years 1989–2002, when the AWA is positively biased by nearly 50 km, while the SDF is approximately unbiased.

A plot of population density function *d*(*s, t*) for Pacific hake (Fig. ) is characteristic of the patterns estimated by the SDF model for West Coast species. For Pacific hake, the areas offshore of Point Conception and the San Francisco Bay generally have high density, but density near the San Francisco Bay is particularly high from 2001 to 2013, and areas offshore of southern Oregon have particularly high densities from 2003 to 2008. In aggregate, the population has a northward distribution during 1989–2009 and relatively southward distribution in 1977–1986 and 2010–2013 (Fig. ). Changes among years often exceed the standard error of the estimated COG (e.g. 2009–2010), indicating changes that are statistically significant. A comparison of the model‐based estimate of COG and the AWA (Fig. ) again shows large differences between estimators in 1980–1986 (when sampling had greater intensity northwards in the California Current) and relatively small differences in 2003–2013 (when sampling intensity is close to uniform north of Point Conception).

We next present estimates of the COG for each of 18 species along the north–south axis (i.e. to detect northward or southward movement over time, Fig. ) for both AWA and model‐based estimators (while analysing the triennial and annual surveys separately with the AWA estimator). The two estimators show different trends for many species during both the triennial and annual periods, for example Dover sole which has a northward trend during the triennial period (1977–2004) in the SDF estimator but a southward trend in AWA estimator. Inspecting results across species during the triennial period (1977–2004), the AWA estimator shows a shift that is more southerly than the SDF estimator for 16 of 18 species, where this southern shift is in‐line with the southern trend in the location of sampling during triennial survey (Fig. ). In particular, the AWA estimator shows significant southward shifts for two species and northward trends for one species from 1977 to 2004, while the SDF estimator shows significant northward shifts for seven species and significant southward shifts for only one species. Inspecting confidence intervals in the SDF estimator (Fig. ) also illustrates that pelagic species (Pacific hake and spiny dogfish) generally have interannual variability that is large relative to confidence interval width, whereas rockfishes generally have less evidence of interannual variability in COG.

Inspecting results from the SDF estimator for each species and all available years (1977–2013, Fig. ) illustrates six of the species have significant northward shifts, while only two (Pacific hake and sablefish) have significant southward shifts. Both hake and sablefish have had approximately steady area occupied during this period, so shifts in distribution have been caused by displacement of the population range, rather than expansion or contraction. Similarly, four of the six species with northward shifts have approximately steady area occupied. However, two species (darkblotched and greenstriped rockfishes) show both significant northward shifts and substantial decreases in area occupied (Fig. ), indicating that the northward shift is caused by decreased density in southern habitats. This decreased density in southern habitats is also reflected in SDF estimates of the southern population boundary, which has moved northwards for both species (Appendix S6).

Understanding the consequences of climate change on terrestrial and aquatic species requires unbiased estimates of how species’ ranges shift. In this study, we have demonstrated that a SDF estimator for distribution shifts offers three benefits over conventional estimators:

*et al*. ; Feeley & Silman ), where spatial variation in sampling intensity can lead to biased estimates of geographical distribution. However, spatial‐varying sampling intensity has not to our knowledge been discussed as causing biased estimates of changes in species distribution over time. By contrast, our SDF estimator will generally be unbiased as long as changes in sampling intensity are statistically independent of changes in population abundance.

Estimated changes in species distributions can then be used to support hypotheses regarding causal environmental drivers, project future change (both in habitat utilization and the ecological niche that organisms inhabit) and identify management actions that may mitigate against these changes.

Our case study application involving marine species on the west coast of the USA shows that a conventional estimator can lead to inference about range shifts in the opposite direction of inference from the SDF estimator. In particular, the southerly trend in the AWA estimator for some species reflects the southward shift in sampling that occurred during the triennial survey. The SDF estimator illustrates that pelagic species (Pacific hake and spiny dogfish) exhibit substantial variability in northward COG and that this variability exceeds the estimated standard error for each individual year. This result supports previous observations that Pacific hake distribution varies substantially over short time periods (Agostini *et al*. ). Spiny dogfish has also been documented previously to have demographics that vary over time (Taylor & Gallucci ), but spatial variation in distribution has received less attention than for Pacific hake. By contrast, rockfishes and thornyheads (*Sebastes* and *Sebastalobus* spp.) generally have very little interannual variability in north–south distribution. These species have widely varying life history, but generally have at least some association with demersal habitats that are thought to be relatively constant through time.

We have not linked our results explicitly to environmental variables, although marine species have previously been documented to shift in distribution with temperature changes (Pinsky *et al*. ; Hiddink, Burrows & García Molinos ). The SDF model that we use here could be linked to climate variables in at least three alternative ways. First, an environmental variable that varies spatially (e.g. local temperature at each location *s* and year *t*) could be included as a spatial covariate in the encounter probability or positive density functions (i.e. included in *x*(*s, t*)) if its value is known everywhere throughout the population domain (Shelton *et al*. ). This approach would permit the analyst to project changes in species distribution arising from different temperature scenarios that potentially vary spatially using output downscaled climate projection models. Secondly, an annual time series (e.g. average regional or global temperature) could be included as a covariate to predict changes in population‐wide abundance, COG or width of the population kernel. This latter approach could be used to test, for example, whether changes in temperature lead to a more concentrated population distribution. Thirdly, temperature information could be used to compute local climate velocities (i.e. the ratio of temporal and spatial gradients in temperature at each location), and the spatial average of this local climate velocity could be compared with population‐wide changes in COG to test whether the population is keeping pace with local temperature shifts (Devictor *et al*. ; Loarie *et al*. ). Each approach is suitable for different types of climate questions, and evaluating the relative merits of each approach remains an important topic for future research.

We recommend further research regarding distributional changes for rare or difficult‐to‐detect species. This can be accomplished by simultaneously estimating the distribution of rare and abundant species, such that estimates for rare species ‘borrow information’ from abundant species (Ovaskainen & Soininen ; Thorson *et al*. ). We also recommend further research regarding age‐ and size‐structured species distribution models. Many species including Pacific hake (Hicks *et al*. ), lingcod (Hamel, Sethi & Wadsworth ) and summer flounder (Bell *et al*. ) are known to have different spatial distribution for old and young individuals. Given the large variability in recruitment seen for most marine species (Thorson, Jensen & Zipkin ), fluctuations in recruitment can therefore drive large, interannual variation in the populations COG, where years following strong recruitment are biased towards the distribution for recruits. Fluctuations in distribution caused by variation in age structure might therefore be confused with climate‐driven shifts in distribution, especially for short‐lived species with strong cohorts (e.g. Pacific hake) or for long‐lived species that rebuild their age structure following a reduction in fishing effort (e.g. summer flounder). Age‐ or size‐structured distribution models could be estimated by either separately analysing the distribution for each age or size bin or jointly analysing them via some smoother across age or size (Kristensen *et al*. ). However, this may be complicated, given that individuals of different age or size often have different susceptibility to sampling gear. Nevertheless, we hypothesize that analysing climatic drivers of marine species distribution may be misleading unless care is taken to control for age‐based distributional effects.

We thank Aurelie Godin, Anne Boudreau, Jim Hastie, Michelle McClure, Andrew Shelton and Jon Reum for helpful preliminary discussions, and the entire NWFSC assessment team for discussions about the shifts in sampling in the triennial survey. We also thank the many scientists and volunteers who contributed to the triennial and West Coast groundfish bottom trawl surveys. Finally, we thank Isaac Kaplan and two anonymous reviewers for helpful comments on an earlier draft.

All data are publicly available from the Northwest Fisheries Science Center, National Marine Fisheries Service, NOAA. The full and up‐to‐date data are available at