WorksPubMed
Accounting for spatial dependence in random forests improves ecological understanding and enhances prediction.
A preview from PubMed. Valency holds this work's metadata and abstract, not its full text.
Abstract
Random forests (RFs) are widely used in ecology to model complex, nonlinear relationships among environmental variables and to summarize fitted relationships through variable importance and interactions. However, many ecological datasets, particularly observational data collected across space, exhibit spatial dependence. If this spatial dependence is ignored, RFs can incorrectly attribute importance to predictors that serve at least partly as proxies for spatial location. In this study, we evaluate how accounting for spatial dependence changes both predictive performance and ecological interpretation. Using simulations with known data-generating mechanisms and an analysis of 1061 North American river catchments, we compare standard RFs, RFs with spatial residual modeling, and a model-agnostic spatial decorrelation transformation. The simulations show that spatially structured noise variables and raw coordinates can receive inflated importance in standard RF workflows, whereas decorrelation reduces these artifacts and recovers the relevant predictors more consistently. In the river flow application, decorrelation improves held-out prediction and shifts interpretation from broad spatially smooth gradients toward hydrologic and soil variables with more direct mechanistic links to flow seasonality.