Cross-validation strategies for data with temporal, spatial, hierarchical, or phylogenetic structure

Ecological data often show temporal, spatial, hierarchical (random effects), or phylogenetic structure. Modern statistical approaches are increasingly accounting for such dependencies. However, when performing cross-validation, these structures are regularly ignored, resulting in serious underestimation of predictive error. One cause for the poor performance of uncorrected (random) cross-validation, noted often by modellers, are dependence structures in the data that persist as dependence structures in model residuals, violating the assumption of independence. Even more concerning, because often overlooked, is that structured data also provides ample opportunity for overfitting with non-causal predictors. This problem can persist even if remedies such as autoregressive models, generalized least squares, or mixed models are used. Block cross-validation, where data are split strategically rather than randomly, can address these issues. However, the blocking strategy must be carefully considered. Blocking in space, time, random effects or phylogenetic distance, while accounting for dependencies in the data, may also unwittingly induce extrapolations by restricting the ranges or combinations of predictor variables available for model training, thus overestimating interpolation errors. On the other hand, deliberate blocking in predictor space may also improve error estimates when extrapolation is the modelling goal. Here, we review the ecological literature on non-random and blocked cross-validation approaches. We also provide a series of simulations and case studies, in which we show that, for all instances tested, block cross-validation is nearly universally more appropriate than random cross-validation if the goal is predicting to new data or predictor space, or for selecting causal predictors. We recommend that block cross-validation be used wherever dependence structures exist in a dataset, even if no correlation structure is visible in the fitted model residuals, or if the fitted models account for such correlations.

[1]  Ben Collen,et al.  Global effects of land use on local terrestrial biodiversity , 2015, Nature.

[2]  Simon Ferrier,et al.  Space can substitute for time in predicting climate-change effects on biodiversity , 2013, Proceedings of the National Academy of Sciences.

[3]  D. Penny The comparative method in evolutionary biology , 1992 .

[4]  R. G. Davies,et al.  Methods to account for spatial autocorrelation in the analysis of species distributional data : a review , 2007 .

[5]  Jianguo Wu,et al.  A spatially explicit hierarchical approach to modeling complex ecological systems: theory and applications , 2002 .

[6]  D. Lieske,et al.  A Robust Test of Spatial Predictive Models: Geographic Cross-Validation , 2011 .

[7]  Edmond Chow,et al.  A cross-validatory method for dependent data , 1994 .

[8]  Jane Elith,et al.  Spatial data for modelling and management of freshwater ecosystems , 2012, Int. J. Geogr. Inf. Sci..

[9]  M. Stone Cross‐Validatory Choice and Assessment of Statistical Predictions , 1976 .

[10]  J. Shao Linear Model Selection by Cross-validation , 1993 .

[11]  Edward J. Rykiel,et al.  Testing ecological models: the meaning of validation , 1996 .

[12]  Sylvain Arlot,et al.  A survey of cross-validation procedures for model selection , 2009, 0907.4728.

[13]  Owen L. Petchey,et al.  The ecological forecast horizon, and examples of its uses and determinants , 2015, bioRxiv.

[14]  Mark S Boyce,et al.  Selection, use, choice and occupancy: clarifying concepts in resource selection studies. , 2013, The Journal of animal ecology.

[15]  John W. Williams,et al.  DISSIMILARITY ANALYSES OF LATE-QUATERNARY VEGETATION AND CLIMATE IN EASTERN NORTH AMERICA , 2001 .

[16]  Bruce L. Webber,et al.  Here be dragons: a tool for quantifying novelty due to covariate range and correlation change when projecting species distribution models , 2014 .

[17]  B T Grenfell,et al.  Noisy Clockwork: Time Series Analysis of Population Fluctuations in Animals , 2001, Science.

[18]  Brian J. McGill,et al.  Can niche-based distribution models outperform spatial interpolation? , 2007 .

[19]  M. Araújo,et al.  Validation of species–climate impact models under climate change , 2005 .

[20]  J. Elith,et al.  Determinants of reproductive success in dominant pairs of clownfish: a boosted regression tree analysis. , 2011, The Journal of animal ecology.

[21]  D. Sumpter The principles of collective animal behaviour , 2006, Philosophical Transactions of the Royal Society B: Biological Sciences.

[22]  Chris Brunsdon,et al.  Geographically Weighted Regression: The Analysis of Spatially Varying Relationships , 2002 .

[23]  Steven J. Phillips,et al.  The art of modelling range‐shifting species , 2010 .

[24]  D. Ackerly,et al.  A trait-based test for habitat filtering: convex hull volume. , 2006, Ecology.

[25]  R. Pearson Climate change and the migration capacity of species. , 2006, Trends in ecology & evolution.

[26]  Koenig,et al.  Spatial autocorrelation of ecological phenomena. , 1999, Trends in ecology & evolution.

[27]  Aoife Foley,et al.  Current methods and advances in forecasting of wind power generation , 2012 .

[28]  Xiao-Jun Zhang,et al.  On the Theory of Forecast Horizon in Equity Valuation , 1999 .

[29]  M. Austin Spatial prediction of species distribution: an interface between ecological theory and statistical modelling , 2002 .

[30]  Richard J. Telford,et al.  Technical note: Estimating unbiased transfer-function performances in spatially structured environments , 2015 .

[31]  J Elith,et al.  A working guide to boosted regression trees. , 2008, The Journal of animal ecology.

[32]  Ken D. Bovee,et al.  Application and testing of a procedure to evaluate transferability of habitat suitability criteria , 1993 .

[33]  Vincent Bretagnolle,et al.  Spatial leave‐one‐out cross‐validation for variable selection in the presence of spatial autocorrelation , 2014 .

[34]  Sam Veloz,et al.  Spatially autocorrelated sampling falsely inflates measures of accuracy for presence‐only niche models , 2009 .

[35]  José Manuel Benítez,et al.  On the use of cross-validation for time series predictor evaluation , 2012, Inf. Sci..

[36]  M. Fortin,et al.  Measuring ecological niche overlap from occurrence and spatial environmental data , 2012 .

[37]  M. Fortin,et al.  Spatial pattern and ecological analysis , 1989, Vegetatio.

[38]  Boris Schröder,et al.  Climate change shifts environmental space and limits transferability of treeline models , 2014 .

[39]  J. Svenning,et al.  Ice age distributions of European small mammals: insights from species distribution modelling , 2009 .

[40]  B. Manly,et al.  Resource selection by animals: statistical design and analysis for field studies. , 1994 .

[41]  Max Kuhn,et al.  Applied Predictive Modeling , 2013 .

[42]  John Bell,et al.  A review of methods for the assessment of prediction errors in conservation presence/absence models , 1997, Environmental Conservation.

[43]  Leo Breiman,et al.  Random Forests , 2001, Machine Learning.

[44]  Carin Andersson,et al.  Biases in the estimation of transfer function prediction errors , 2004 .

[45]  T. Hastie,et al.  Bias correction in species distribution models: pooling survey and collection data for multiple species , 2014, Methods in ecology and evolution.

[46]  Robert P. Anderson,et al.  A framework for using niche models to estimate impacts of climate change on species distributions , 2013, Annals of the New York Academy of Sciences.

[47]  A. Hamann,et al.  Predicting potential climate change impacts with bioclimate envelope models: a palaeoecological perspective , 2012 .

[48]  P. Legendre Spatial Autocorrelation: Trouble or New Paradigm? , 1993 .

[49]  Boris Schr Computer-intensive methods in the analysis of species-habitat relationships , 2003 .

[50]  J. Tenedório,et al.  Predicting the impact of climate change on the invasive decapods of the Iberian inland waters: an assessment of reliability , 2012, Biological Invasions.

[51]  L. A. Stone,et al.  Computer Aided Design of Experiments , 1969 .

[52]  Paul D.M. Hughes,et al.  Statistical testing of a new testate amoeba‐based transfer function for water‐table depth reconstruction on ombrotrophic peatlands in north‐eastern Canada and Maine, United States , 2013 .

[53]  D. Lindenmayer,et al.  Towards a hierarchical framework for modelling the spatial distribution of animals , 2001 .

[54]  Robert P. Anderson,et al.  Making better Maxent models of species distributions: complexity, overfitting and evaluation , 2014 .

[55]  J. Felsenstein Phylogenies and the Comparative Method , 1985, The American Naturalist.

[56]  E. Ranta,et al.  Population variability in space and time. , 2000, Trends in ecology & evolution.

[57]  Martin Vavra,et al.  Validation of Elk Resource Selection Models with Spatially Independent Data , 2011 .

[58]  Ingolf Kühn,et al.  Incorporating spatial autocorrelation may invert observed patterns , 2006 .

[59]  M. Boyce,et al.  Evaluating resource selection functions , 2002 .

[60]  Jun Zhu,et al.  Statistics for correlated data: phylogenies, space, and time. , 2006, Ecological applications : a publication of the Ecological Society of America.

[61]  Jeffrey S. Racine,et al.  Consistent cross-validatory model-selection for dependent data: hv-block cross-validation , 2000 .

[62]  B. W. Rust,et al.  Importance of validation in ecosystem analysis , 1975 .

[63]  Richard A. Davis,et al.  Introduction to time series and forecasting , 1998 .

[64]  David L. Verbyla,et al.  Resampling methods for evaluating classification accuracy of wildlife habitat models , 1989 .

[65]  H. Rue,et al.  Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations , 2009 .

[66]  J. Elith,et al.  Do they? How do they? WHY do they differ? On finding reasons for differing performances of species distribution models , 2009 .

[67]  Ronald D. Snee,et al.  Validation of Regression Models: Methods and Examples , 1977 .

[68]  Ron Kohavi,et al.  A Study of Cross-Validation and Bootstrap for Accuracy Estimation and Model Selection , 1995, IJCAI.

[69]  Donald A. Jackson,et al.  Predictive Models of Fish Species Distributions: A Note on Proper Validation and Chance Predictions , 2002 .

[70]  H. Balslev,et al.  Dispersal and niche evolution jointly shape the geographic turnover of phylogenetic clades across continents , 2013, Scientific Reports.

[71]  Douglas M. Hawkins,et al.  The Problem of Overfitting , 2004, J. Chem. Inf. Model..

[72]  Richard J. Telford,et al.  Evaluation of transfer functions in spatially structured environments , 2009 .

[73]  A. Grafen The phylogenetic regression. , 1989, Philosophical transactions of the Royal Society of London. Series B, Biological sciences.

[74]  Robert B. Blair,et al.  Spatial and temporal variations in species occurrence rate affect the accuracy of occurrence models , 2006 .

[75]  Nicola Koper,et al.  Generalized estimating equations and generalized linear mixed-effects models for modelling resource selection , 2009 .

[76]  Liam J. Revell,et al.  Phylogenetic signal and linear regression on species data , 2010 .

[77]  Ashutosh Kumar Singh,et al.  The Elements of Statistical Learning: Data Mining, Inference, and Prediction , 2010 .

[78]  Gary C. White,et al.  Autocorrelation of location estimates and the analysis of radiotracking data , 1999 .

[79]  A. Townsend Peterson,et al.  Novel methods improve prediction of species' distributions from occurrence data , 2006 .

[80]  Mathieu Marmion,et al.  Does the interpolation accuracy of species distribution models come at the expense of transferability , 2012 .

[81]  Trevor S. Wiens,et al.  Three way k-fold cross-validation of resource selection functions , 2008 .

[82]  Volker Bahn,et al.  A New Method for Evaluating Species Distribution Models , 2009 .

[83]  A. Hamann,et al.  Method selection for species distribution modelling: are temporally or spatially independent evaluations necessary? , 2012 .

[84]  B. McGill,et al.  Testing the predictive performance of distribution models , 2013 .

[85]  N. Breslow,et al.  Approximate inference in generalized linear mixed models , 1993 .

[86]  Boris Schröder,et al.  Are habitat models transferable in space and time , 2000 .

[87]  Damaris Zurell,et al.  Predicting to new environments: tools for visualizing model behaviour and impacts on mapped distributions , 2012 .

[88]  John W. Tukey,et al.  Data Analysis and Regression: A Second Course in Statistics , 1977 .

[89]  S. Lavorel,et al.  Effects of restricting environmental range of data to project current and future species distributions , 2004 .

[90]  J. Sauer,et al.  Consistent response of bird populations to climate change on two continents , 2016, Science.

[91]  Noel A Cressie,et al.  Statistics for Spatial Data. , 1992 .

[92]  R. Dennis Cook,et al.  Cross-Validation of Regression Models , 1984 .

[93]  S. Jackson,et al.  Novel climates, no‐analog communities, and ecological surprises , 2007 .

[94]  Mike Rees,et al.  5. Statistics for Spatial Data , 1993 .

[95]  N. D. Pidgen,et al.  The Comparative Method , 1987 .

[96]  Michael Power,et al.  The predictive validation of ecological and environmental models , 1993 .

[97]  Paul L. Angermeier,et al.  Factors influencing behavior and transferability of habitat models for a benthic stream fish , 1997 .

[98]  Jennifer A. Miller,et al.  Incorporating spatial dependence in predictive vegetation models , 2007 .

[99]  Diego Nieto-Lugilde,et al.  Modeling Species and Community Responses to Past, Present, and Future Episodes of Climatic and Ecological Change , 2015 .

[100]  Julian D. Olden,et al.  Assessing transferability of ecological models: an underappreciated aspect of statistical validation , 2012 .

[101]  T. Hayden,et al.  Autocorrelated data in telemetry studies: time to independence and the problem of behavioural effects , 1998 .