Recent advances in spatial modelling of distance sampling surveys

David L. Miller (http://converged.yt)

CSIRO, Hobart

19 April 2016

Who is this guy?

  • Currently:
    • NOAA Northeast Fisheries Science Center (sic), Woods Hole, MA
    • (“Honourary” (ha!) position at St Andrews)
  • Previously:
    • Centre for Research into Ecological and Environmental Modelling, St Andrews
    • University of Rhode Island
    • PhD Bath, UK; spatial modelling w/ Simon Wood
  • Why am I here?
    • Collab w/ Mark Bravington, Nat Kelly
not a real statistician,
not a real ecologist.

with that in mind...

(a talk)

Ecological questions

How many animals are there?

Where are all the animals?

Why are they there?

Practical question

How can we do this?

(Statistical methods)

(Software)

Density surface models

(Spatial models that account for detectability)

(…and more)

2-(or more) stage models




Hedley and Buckland (2004). Miller et al (2013).

Let's talk about detectability

Detectability

Distance sampling

  • “Fit to the histogram”
  • Model:

\[ \mathbb{P} \left[ \text{animal detected } \vert \text{ animal at distance } y\right] = g(y;\boldsymbol{\theta}) \]

  • Calculate the average probability of detection:

\[ \hat{p} = \frac{1}{w} \int_0^w g(y; \boldsymbol{\hat{\theta}}) \text{d}y \]

Distance sampling (extensions)

  • Covariates that affect detectability (Marques et al, 2007)
  • Perception bias (\( g(0)<1 \)) (Burt et al, 2014)
  • Availability bias (Winiarski et al, 2013; Borchers et al, 2013)
  • Detection function formulations (Miller and Thomas, 2015)
  • Measurement error (Marques, 2004)  

Figure from Marques et al (2007)

Horvitz-Thompson-like estimators

  • Rescale the (flat) density and extrapolate

\[ \hat{N} = \frac{\text{study area}}{\text{survey area}}\sum_{i=1}^n \frac{s_i}{\hat{p}_i} \]

(where \( s_i \) are group/cluster sizes)

Spatially explicit models

Data setup

Ursus from PhyloPic.

Generalized additive models

Taking the previous example…

\[ n_j = \color{red}{A_j}\color{blue}{\hat{p}_j} \color{green}{\exp}\left[\color{grey}{ \beta_0 + \sum_k f_k(z_{kj})} \right] + \epsilon_j \]

where \( \epsilon_j \sim N(0, \sigma^2) \), \( \quad n_j\sim \) count distribution

  • \( \color{red}{\text{area of segment}} \)
  • \( \color{blue}{\text{probability of detection in segment}} \)
  • \( \color{green}{\text{(inverse) link function}} \)
  • \( \color{grey}{\text{model terms}} \)

Generalized additive models

plot of chunk wiggles

“just wiggly enough”

Fitting via REML, see Wood (2011).

Response distributions

  • “Classically”: quasi-Poisson (I've not seen data like this)
  • Lately: Tweedie, negative binomial
  • Exponential family given power parameter
  • (can now estimate power parameters)

SPOILER ALERT: your model is probably just a very fancy GLM

Black bears in Alaska

Surveying in AK

  • Area of 26,482 km2 (~39% size of Tasmania)
  • Double observer surveys using Piper Super Cubs
  • 1238, 35km transects, 2001-2003

1238 transects

Survey protocol

  • Surveys in Spring, bears are there, but not too much foliage
  • Generally search uphill
  • Double observer (Burt et al, 2014)
  • Curtain between pilot and observer; light system
  • Go off transect and circle to ID

Black bears

  • Truncate at 22m and 450m, leaving 351 groups (out of ~44,000 segments)
  • Group size 1-3 (lone bears, sow w. cubs)
  • 1402m elevational cutoff

Detection function

  • 2-part normal detection function (Becker & Christ, 2015)
  • Avoid heavy left truncation (discard ~30% data)
  • Modelling by EB

Environmental covariates

"Bears don't like to go too high"

"Bears like to sunbathe"

Model selection & checking

So we're done? Nope.

  • Residuals check plots (Dunn and Smyth, 1996)
  • Need to make smooths “wiggly enough”
  • Term selection
  • Tobler's law

Model selection

  • All possible subsets - expensive; stepwise - path dependence
  • Term selection by shrinkage to zero effect (Marra & Wood, 2011)
  • Approximate \( p \)-values (Marra and Wood, 2012)

Tobler's first law of geography

“Everything is related to everything else, but near things are more related than distant things”

Tobler (1970)

Concurvity

\[ \text{Altitude} = f(x,y) + \epsilon \quad \text{or} \quad \text{Slope} = f(Altitude) + \epsilon \]

  • Not just linear correlation!
  • mgcv::concurvity() computes measures for fitted models

What can we do about this?

  • Careful inclusion of terms
  • Fit models using robust criteria (REML)
  • Test for concurvity (mgcv::concurvity)
  • Test for sensitivity (lots of models)

What is the "right" model?




¯\_(ツ)_/¯

Inference

Abundance estimate for GMU13E

  • H-T estimate: ~1500 black bears
  • DSM estimate: ~1200 black bears (968 - 1635, CV ~13%)
  • Not a huge difference, so why bother?

Abundance map

Variance

  • Need to propagate uncertainty!
  • This is hard, but can be done!
  • Refit model with “extra” term

\[ n_j = A_j p_j \exp \left\{ \color{red}{\left[\frac{ \partial \log p_j(\boldsymbol{\theta})}{\partial\boldsymbol{\theta}} \Big\vert_{\boldsymbol{\theta} = \hat{\boldsymbol{\theta}}}\right] \boldsymbol{\gamma}} + \beta_0 + \sum_k f_k(z_{jk}) \right\} \]

  • random effect – fix the corresponding variance matrix \( \boldsymbol{\gamma} \sim N(0,-\mathbf{H}^{-1}_\theta) \)
  • Bravington, Hedley & Miller (in prep)

Coefficient of variation map

Conclusions

Distance sampling software

  • Distance for Windows
    • Easy to use Windows software
  • Distance R package
    • Simple way to fit detection functions
  • mrds R package
    • More complex analyses - double observer surveys

Density surface models in R

  • Easy to build simple models, possible to build complex ones
  • Syntax example:
model <- dsm(count ~ s(x,k=10) + s(slope,k=6),
             detection_function,
             segment_data, observation_data,
             family=tw(), method="REML")
  • Utility functions: variance estimation, plotting, prediction etc

Conclusions

  • This methodology is general
    • Bears, birds, beer cans, Loch Ness monsters can all be modelled
  • Models are flexible!
    • Linear things, smooth things, random effect things (and more)
  • If you know GLMs, you can get started with DSMs
    • Mature theoretical basis, still lots to do
  • Active user community, active software development

Acknowledgements (general)

  • St Andrews: Eric Rexstad, Len Thomas, Louise Burt, Laura Marshall, Steve Buckland, Sharon Hedley
  • Duke: Jason Roberts, Laura Mannocci
  • CSIRO: Mark Bravington
  • Antarctic Division: Natalie Kelly
  • Funding: University of St Andrews, State of Rhode Island, US Navy, NOAA, International Whaling Commission

Acknowledgements (Alaska)

  • Earl Becker, Becky Strauch, Mike Litzen, Dave Filkill

Funding from Alaska Department of Fish and Game

Resources

Thanks!

Slides w/ references available at converged.yt

References

Borchers, D. L., Zucchini, W., Heide-Jørgensen, M. P., Cañadas, A., Langrock, R., Buckland, S. T., & Marques, T. A. (2013). Using hidden Markov models to deal with availability bias on line transect surveys. Biometrics, 69(3).
Burt, M. L., Borchers, D. L., Jenkins, K. J., & Marques, T. A. (2014). Using mark-recapture distance sampling methods on line transect surveys. Methods in Ecology and Evolution, 5(11).
Becker, E. F., & Christ, A. M. (2015). A Unimodal Model for Double Observer Distance Sampling Surveys. PLoS ONE.
Dunn, P. K., & Smyth, G. K. (1996). Randomized Quantile Residuals. Journal of Computational and Graphical Statistics, 5(3).
Hedley, S. L., & Buckland, S. T. (2004). Spatial models for line transect sampling. Journal of Agricultural, Biological, and Environmental Statistics, 9(2).
Marques, T. A. (2004). Predicting and correcting bias caused by measurement error in line transect sampling using multiplicative error models. Biometrics, 60(3).
Marques, T. A., Thomas, L., Fancy, S. G., & Buckland, S. T. (2007). Improving estimates of bird density using multiple-covariate distance sampling. The Auk, 124(4).
Marra, G., & Wood, S. N. (2011). Practical variable selection for generalized additive models. Computational Statistics and Data Analysis, 55(7).
Marra, G., & Wood, S. N. (2012). Coverage Properties of Confidence Intervals for Generalized Additive Model Components. Scandinavian Journal of Statistics, 39(1).
Miller, D. L., Burt, M. L., Rexstad, E. A., & Thomas, L. (2013). Spatial models for distance sampling data: recent developments and future directions. Methods in Ecology and Evolution, 4(11).
Miller, D. L., & Thomas, L. (2015). Mixture models for distance sampling detection functions. PLoS ONE.

Appendices

Appendix - REML

Taken from Wood (2011)

Appendix - Availability

  • “Simple correction factor” for diving animals (Winiarski et al 2014)
  • Borchers & co have many solutions using Hidden Markov Models

Appendix - Smoothing in awkward regions

Ramsay (2002). Wood, Bravington & Hedley (2008).

Appendix - Miller and Wood (2014)

  • Calculate within-area distances
  • Use multidimensional scaling to project (high usually)
  • Use Duchon splines for smoothing
  • Use GCV/REML for dimension selection

Appendix - Mixture model detection functions


Data from Daniel Pike, Bjarni Mikkelsen and Gísli Vikingsson. Marine Research Institute, Iceland.

Appendix - Mixture model detection functions

  • Miller and Thomas (2015)