Accounting for spatial dependence in random forests improves ecological understanding and enhances prediction
Related Experiment Video
Updated: Nov 7, 2026

Development of an Individual-Tree Basal Area Increment Model using a Linear Mixed-Effects Approach
Published on: July 3, 2020
Matthew J Heaton1, Michael Dumelle2, Kelvyn K Bladen3
1Department of Statistics, Brigham Young University, Provo, Utah, USA.
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.
Related Concept Videos
Survival Tree
Building a Survival Tree
Constructing a survival tree begins...
Distribution and Dispersion
Multiple Regression
Farmers can use multiple regression to determine the crop yield based on more than one factor, such as water availability, fertilizer, soil properties, etc. Here, the crop yield is the response or dependent variable as it depends on the other independent variables. The analysis requires the construction of a scatter plot...
Residuals and Least-Squares Property
If the observed data point lies above the line, the residual is positive, and the line underestimates the actual data value for y. If the observed data point lies below the line, the residual is negative, and the line overestimates the actual data value for y.
The process of fitting the best-fit...
Ecological Disturbance
Regression Analysis
In regression analysis, a regression equation is determined based on the line of best fit– a line that best fits the data points plotted in a graph. This line is also called the regression line. The algebraic equation for the regression line is called the regression equation. It is represented as: