Generalized covariate field

Cite this method

Song, Y. (2026). Generalized covariate field (GCF): spatial-pattern and neighbourhood-distribution feature expansion improves geospatial prediction. International Journal of Geographical Information Science, 40, 1–29. https://doi.org/10.1080/13658816.2026.2729719

Full text · BibTeX · Code · Web app
This article describes the spatial representation model. For the R package and online calculator, see § Software. For the original paper, see Song (2026).

The generalized covariate field (GCF) is a spatial representation model for geospatial prediction that expands each explanatory variable, or covariate, from its value at a location into a set of features describing the spatial structure and neighbourhood distribution of that covariate around the location.[1] The model was introduced by Yongze Song in 2026 in the International Journal of Geographical Information Science. GCF is intended for prediction problems in Earth and environmental sciences in which the response variable is observed at sparse or unevenly distributed sample locations, while covariates are available continuously across the study area, including at locations where no response has been observed.

GCF organizes predictors into three categories: the original predictors, spatial pattern features derived by applying eleven neighbourhood operators to each covariate, and neighbourhood distribution features obtained by summarizing covariate values within multiscale neighbourhoods using quantiles. The resulting high-dimensional candidate set is reduced by a two-stage variable selection procedure consisting of response-independent functional reduction and spatial-block stability selection, after which any supervised learner may be trained on the selected features.[1] The term generalized refers to the fact that three conventional predictor sets, namely covariates alone, covariates with spatial features, and covariates with neighbourhood statistics, arise as special cases of the GCF representation.

In a case study predicting vascular plant species richness across the Southwest Australian Floristic Region, GCF expanded 12 environmental covariates into 3,276 candidate predictors and improved spatial-block cross-validated R2 by 8.2–21.1% relative to covariate-only models across seven learners.[1] The results are presented as support for the primacy of data hypothesis, which holds that enriching the spatial representation of data can improve prediction more than increasing model structural complexity.

Background

Spatial prediction supports tasks such as climate modelling, biodiversity monitoring, ecosystem assessment, and natural hazard forecasting, and requires reliable estimates at unsampled or sparsely monitored locations as well as at observed ones.[2] Although advances in remote sensing have increased the availability and resolution of spatial data, more data alone does not guarantee higher prediction accuracy for complex systems,[3] and prediction remains constrained by spatial heterogeneity and by sparse, uneven sampling.

Methods for spatial prediction are commonly grouped into spatial statistical models such as kriging, spatial autoregressive models and geographically weighted regression; spatially informed machine learning, including random forests, gradient boosting and support vector machines with spatial covariates; and hybrid approaches, including deep learning architectures such as graph convolutional networks.[1] A recurring observation in this literature is that many machine learning models treat observations as independent and do not represent spatial structure, and that emerging approaches address this either by embedding spatial variables into the input space or by adapting the learning algorithm.

GCF belongs to the first of these strategies. Its starting point is the covariate field: because covariates are typically observed on a support that extends beyond the response sample locations, their local distributions and spatial patterns around each prediction location carry information that point covariate values do not.[4] Earlier work by the same research group on the second dimension of spatial association,[5] geocomplexity,[6] and second-dimension outliers[7] examined individual aspects of this information. GCF was developed to generate and integrate spatial pattern and neighbourhood distribution features from covariates systematically, at both sampled and unsampled locations, within a single construction.

Definition

Let 𝒟 denote the study domain, 𝒮𝒟 the sampled locations u at which both covariates x(u) and the response y(u) are observed, and 𝒢𝒟 the prediction grid of locations v at which covariates are available but the response is unobserved. GCF predicts the response at a sampled location through

y(u) = f(Φ(u)),   u𝒮,

where the GCF feature vector

Φ(s) = [ x(s),  ψ(x)(s),  {Zx(s; b, τ)} ]

is defined at every location s with covariate support, and the learner f is any supervised model. The methodological contribution of GCF lies in the construction of Φ rather than in the choice of f.[1]

The paper defines the spatial representation of data as the quantities supplied to a learner as predictors for each location, comprising the covariate values at that location together with quantities encoding the spatial structure of the covariate field in its neighbourhood. Under this definition, the covariate vector x(s) is the point-support representation and Φ(s) is an enriched representation built from the same observations without adding response samples.

Predictor categories

GCF organizes predictors into three categories, each retaining the identity of the covariate from which it is derived:

The construction is implemented in four steps: generation of spatial pattern features, generation of neighbourhood distribution features, variable selection, and spatial learning.

Simulated dependent and independent variables with examples of spatial pattern features and neighbourhood distribution features
Figure 1. Simulated response and explanatory variables on a 30 × 30 grid, with representative spatial pattern features for one explanatory variable and neighbourhood distribution features used in the GCF model.

Spatial pattern features

For each covariate x, the spatial pattern operator produces an h-dimensional vector ψ(x)(s) = (ψ1(x)(s), …, ψh(x)(s)), where each component is computed from the values of x within the neighbourhood 𝒩(s). The same set of operators is applied independently to every covariate. The published implementation uses eleven operators in six categories.[1]

Table 1. Spatial pattern operators used in GCF
CategoryOperatorSymbolWhat it measuresOrigin
Spatial dependenceTransferable LISA-type statisticψLLocal spatial association computed from locally standardized values, removing broad-scale differences in level and variabilityAdapted from local indicators of spatial association[8]
Local Geary's cψCMean squared difference between a location and its neighboursAnselin (1995)[8]
Local heterogeneityLog local varianceψVVariability of covariate values within the neighbourhoodWoodcock & Strahler (1987)
Distributional diversityRank-binned entropyψEEvenness of neighbourhood values across global rank binsBatty (1974)
GeocomplexityGeocomplexityψGLocal spatial complexity accounting for neighbour dependenceZhang et al. (2023)[6]
Multiscale variationLog scale-variance indexψSVariance of block means across nested grid scalesMoellering & Tobler (1972)
Local variogram exponentψTLog-log slope of the local semivariogramOliver & Webster (2014)
Local outlyingnessLocal-z positive outlier strengthψPSummed magnitude of neighbours exceeding a positive z-score thresholdRen et al. (2026)[7]
Local-z negative outlier strengthψNSummed magnitude of neighbours below a negative z-score thresholdRen et al. (2026)[7]
Robust positive outlier strengthψPrAs ψP, using the local median and median absolute deviationAggarwal (2017)
Robust negative outlier strengthψNrAs ψN, using the local median and median absolute deviationAggarwal (2017)

Nine of the eleven operators depend on the neighbourhood radius and are evaluated at each buffer radius, while two are scale-invariant and are computed once per covariate. The operator set is open: any functional of covariate values over a defined spatial support can be added without altering the construction.

Neighbourhood distribution features

Neighbourhood distribution features summarize the distribution of covariate values surrounding each location. For a covariate x, a set of buffer radii b defines multiscale neighbourhoods, and within each neighbourhood a distribution-summary operator Qτ, taken as the quantile at level τ, is applied to the covariate values at locations with covariate support:[5]

Zx(s; b, τ) = Qτ({x(w) : w𝒩(s; b)}).

Each buffer–quantile combination yields one feature. Covariates are kept at their native resolution, so the construction does not require all covariates to be resampled to a common grid. Although quantiles are used in the published implementation, Qτ may be replaced by other distributional summaries such as means, upper-tail statistics, threshold exceedances or entropy.

Variable selection

The candidate set formed by the three predictor categories is high-dimensional and strongly collinear, because neighbouring buffers, adjacent quantile levels and related operators encode similar information. GCF applies a two-stage selection procedure.[1]

Response-independent functional reduction. The buffer set is partitioned into a fine band and a broad band, preserving a near–far contrast. Within each band, the neighbourhood distribution features of a covariate are collapsed into five functionals of the quantile curve: the median, the interquartile range, the lower tail, the upper tail and a skew descriptor. Scale-dependent spatial pattern operators are averaged within each band, and scale-invariant operators pass through unchanged. Because this stage uses covariate information only, it introduces no response leakage.

Spatial-block stability selection. The original predictors are forced into all models and are exempt from selection, so that derived features compete only for information beyond that already represented by x. The study region is partitioned into contiguous square blocks. In each of M resampling rounds, a fraction γ of blocks is sampled, a random forest is fitted, and the top k derived features by impurity importance are marked as selected. Features are grouped by covariate and feature category, and the selection frequency of a group g is

g = (1/M) Σr=1…M 𝕀{ Σjg δrj > 0 },

where δrj = 1 if feature j is selected in round r. Groups with gπ are retained, and each retained group contributes one representative feature, the member with the highest mean selection frequency. The final predictor set is the union of the forced original predictors and the representative derived features. In cross-validation, the whole procedure is re-estimated within each training fold.

Spatial learning and prediction

A supervised learner is trained on the selected feature vector Φ𝒜(u) evaluated at the sampled locations, and prediction at an unknown location v𝒢 is given by ŷ(v) = f𝒜(v)). Because the features are computed wherever covariates are available, the same construction serves both training and prediction, and the predictions form a surface over the prediction grid. The published study uses random forest as the adopted learner and reports six comparison learners.

Conditions for benefit

The paper states three conditions that govern when GCF is expected to improve prediction:[1]

  1. The response depends on the geographical context of a location rather than on its point covariate values alone.
  2. Covariates are observed on a support extending beyond the response sample locations, so that neighbourhood summaries carry information the response samples do not.
  3. The neighbourhood radii span the scales at which the underlying process operates.

Under these conditions, the expected gain increases as the response sample becomes sparser relative to the covariate support, because neighbourhood features supply contextual information unavailable at the sampled locations. Improvements are correspondingly smaller where response sample density approaches the covariate resolution, so that neighbourhood summaries duplicate information already in x, or where the process scale falls outside the range spanned by the buffer radii. The paper also notes that the implemented operators describe local heterogeneity, and that populations dominated by stratified heterogeneity would call for stratum-based operators within the same construction.[9]

Evaluation

GCF was evaluated in a controlled simulation and in an application to plant species richness. Both used five-fold random cross-validation and five-fold spatial-block cross-validation, with variable selection re-estimated in each training fold, and compared GCF models with covariate-only models across seven learners: linear regression (LM), GLMNET, random forest (RF), Cubist, distance-weighted k-nearest neighbours (KNN), XGBoost and a radial-kernel support vector machine (SVM).[1]

Simulation study

The simulation used a regular 30 × 30 grid with a response generated as a spatially autocorrelated Gaussian random field and three explanatory variables formed by adding spatially independent noise to that field (Figure 1). With buffer radii {2, 4, 6}, a normalization radius of 4 and quantile levels from 0 to 1 in steps of 0.1, each explanatory variable produced 63 predictors (1 original, 29 spatial pattern and 33 neighbourhood distribution features), giving 189 candidates in total.

Table 2. Simulation study: spatial-block five-fold cross-validation
LearnerR2, covariate-onlyR2, GCFImprovementRMSE, covariate-onlyRMSE, GCFImprovement
LM0.4690.668+42.4%0.7060.551+22.0%
GLMNET0.4700.668+42.1%0.7070.552+22.0%
RF0.4190.657+56.5%0.7410.561+24.3%
Cubist0.4380.637+45.6%0.7280.575+21.0%
KNN0.4290.637+48.5%0.7360.578+21.5%
XGBoost0.3990.619+55.2%0.7540.590+21.8%
SVM0.4330.591+36.6%0.7340.624+15.0%

Source: Song (2026), Table 2. Improvement is the relative change from the covariate-only model to the GCF model. Random cross-validation results follow the same pattern.

Under spatial-block cross-validation, GCF models achieved R2 between 0.591 (SVM) and 0.668 (LM), compared with 0.399–0.470 for covariate-only models. All seven learners improved under both cross-validation schemes, which the paper interprets as evidence that the improvement is attributable to the GCF representation rather than to any particular learning algorithm. The strong performance of the GCF-based linear model is attributed to the spatial pattern and neighbourhood distribution features encoding much of the spatial structure before model fitting, leaving a comparatively simple mapping from predictors to response.

Case study: plant species richness in southwestern Australia

The application predicted vascular plant species richness across the Southwest Australian Floristic Region (SWAFR), a global biodiversity hotspot with approximately 7,380 native vascular plant species and subspecies, about half of them endemic.[10] Richness observations from 4,989 plots of 400 m2[11] were aggregated to a 10 km grid, yielding 958 spatial units with values ranging from 0.4 to 135.8 (mean 41.1). Twelve covariates in three groups were used: geography (elevation, slope), climate and environment (total precipitation over 2013–2023, shortwave radiation, distance to water, distance to built-up areas), and soil properties (nitrogen, organic carbon, clay fraction, depth, pH, bulk density).

Spatial distribution of species richness samples in the Southwest Australian Floristic Region
Figure 2. Spatial distribution of species richness samples in the Southwest Australian Floristic Region (SWAFR), Australia.

Spatial pattern features were computed over buffer radii of 20 to 100 km in 10 km steps, with a normalization radius of 100 km, and neighbourhood distribution features over the same nine radii at 21 quantile levels. The 12 covariates were thereby expanded into 12 original predictors, 996 spatial pattern features and 2,268 neighbourhood distribution features, a total of 3,276 candidates. Functional reduction with a fine band of {20, 30} km and a broad band of {90, 100} km reduced the set to 372 features. Stability selection used 80 rounds, a block sampling fraction of 0.7, 200-tree random forests, the top 20 features per round, and a retention threshold of 0.6. Applied to the full sample, the procedure retained 9 of 24 covariate-by-category groups, so the final model comprised the 12 original covariates and 9 representative derived features, all located in the 90–100 km broad scale band (Figure 3).

Expansion of twelve covariates into spatial pattern features and neighbourhood distribution features, with the nine derived features selected in the biodiversity case study
Figure 3. Expansion of the twelve original predictors of the biodiversity case study into two derived feature categories (left), with the nine derived features retained by the full-sample variable selection: (a) spatial pattern features; (b) neighbourhood distribution features. ψV = log local variance; ψP = positive z-outlier strength; Zτ = neighbourhood τ-quantile; IQR Z = Z0.75Z0.25.
Absolute Pearson correlation between species richness and GCF-derived candidate predictors by category
Figure 4. Absolute Pearson correlation between species richness and GCF-derived candidate predictors, grouped by predictor category. The strongest neighbourhood distribution features reach |r| = 0.544, exceeding all original covariates (maximum 0.464 for precipitation).

Spatial-block cross-validation used square blocks of side 132 km, twice the spatial-dependence range of about 66 km estimated from the residual variogram of species richness after removing the covariate trend, giving 38 occupied blocks assigned to five spatially disjoint folds.

Random cross-validation folds, empirical variogram, and spatial-block cross-validation folds
Figure 5. Five-fold cross-validation schemes for the biodiversity case: (a) random folds; (b) empirical variogram of species richness used to set the block size; (c) spatial-block folds.
Table 3. Biodiversity case: spatial-block five-fold cross-validation
LearnerR2, covariate-onlyR2, GCFImprovementRMSE, covariate-onlyRMSE, GCFImprovement
RF (adopted)0.2960.346+16.7%17.96617.428+3.0%
Cubist0.2830.342+21.1%18.06517.506+3.1%
KNN0.2960.320+8.2%18.03917.743+1.6%
XGBoost0.2610.315+20.3%18.30417.795+2.8%
SVM0.2750.327+18.6%18.48917.849+3.5%
GLMNET0.2590.302+16.9%18.57518.054+2.8%
LM0.2530.286+13.0%18.64718.279+2.0%

Source: Song (2026), Table 5. Under random cross-validation the corresponding R2 improvements were 0.7–13.2%.

Every learner improved under GCF in both schemes. Under spatial-block cross-validation, R2 increased by 8.2–21.1% and RMSE fell by 1.6–3.5%; under random cross-validation the gains were smaller, at 0.7–13.2% in R2. The larger gains under the stricter spatial-block scheme are interpreted as improved transferability to spatially separated and unsampled areas. A feature-set comparison with random forest showed that adding spatial pattern features alone raised spatial-block R2 from 0.296 to 0.337, adding neighbourhood distribution features alone raised it to 0.329, and the full GCF representation reached 0.346. A Shapley decomposition of the GCF R2 attributed 45.6% to the original covariates, 24.8% to spatial pattern features and 29.6% to neighbourhood distribution features.

Robustness

Robustness analysis under sparse sampling, spatial extrapolation, and covariate scarcity
Figure 6. Robustness of the GCF gain: (a) RMSE gain over covariate-only random forest across training fractions; (b, c) leave-region-out prediction for western, central and eastern regions; (d, e) RMSE and accuracy recovery rate as the strongest covariates are removed first.

Three experiments examined the robustness of the GCF gain (Figure 6). Under sparse sampling, the RMSE gain relative to covariate-only random forest remained positive at all training fractions, increasing from 0.30 at a training fraction of 0.1 to 0.45 at 0.9. In leave-region-out validation, GCF reduced RMSE in all three withheld regions, by 0.85 in the central, 0.79 in the western and 0.24 in the eastern region. Under covariate scarcity, with the strongest covariates removed first, GCF recovered 79% of the full-covariate prediction capacity with five covariates retained, compared with 14% for covariate-only random forest; with a single covariate, RMSE rose by 21% for GCF and 47% for the covariate-only model, and GCF maintained positive R2 throughout whereas the covariate-only model did not when fewer than four covariates remained.

GCF and covariate-only random forest predictions of species richness, cross-sections, and local variance
Figure 7. Species richness prediction: (a) GCF; (b) covariate-only random forest; (c) two cross-sections; (d, e) local variance of each surface; (f) difference in local variance. GCF has lower local variance across 69.8% of the region.

When refitted on all samples and mapped across the prediction grid, the GCF surface showed smoother spatial transitions than the covariate-only random forest surface while preserving high- and low-richness contrasts along cross-sections, and had lower local variance across 69.8% of the region (Figure 7).

Primacy of data

The paper frames its results as support for what it calls the primacy of data hypothesis: that enriching the spatial representation of data, rather than only increasing model structural complexity, can substantially improve prediction.[1] The clearest illustration is the simulation, in which a linear model fitted to GCF features reached a spatial-block R2 of 0.668, above the covariate-only random forest (0.419) and XGBoost (0.399). The argument is that spatial structure that a flexible learner would otherwise need to discover from sparse response data is instead computed explicitly from the covariate field, where it is observable everywhere, and supplied as predictors. This positions GCF within data-centric approaches to geospatial modelling, in which effort is directed to the representation supplied to a model rather than to the model architecture.

Special cases. Three predictor sets used in existing spatial prediction are nested within GCF: the covariates alone (x), covariates with spatial features (x + ψ), and covariates with neighbourhood statistics (x + Zx). In the biodiversity case each of these sets performed below the full representation, and the paper presents this as the sense in which the covariate field is generalized.

Kriging, spatial regression and geographically weighted regression model spatial dependence or spatially varying coefficients in the response, using covariate values at the point of prediction. GCF is complementary: it changes the predictor set, not the learner, and its features may be supplied to such models as covariates.

Focal statistics and neighbourhood summaries in GIS and remote sensing compute moving-window statistics of a raster. The neighbourhood distribution operator of GCF is of this family, extended to multiscale radii and full quantile curves, and combined with a selection procedure designed to prevent response leakage and to enforce spatial reproducibility.

Related methods from the same research group include the second dimension of spatial association,[5] which relates a location to the distribution of values in its neighbourhood and underlies the neighbourhood distribution operator; geocomplexity,[6] which is one of the spatial pattern operators; second-dimension outliers for spatial prediction,[7] on which the outlier-strength operators draw; geographically optimal similarity,[12] which predicts from structurally similar observations rather than proximity; the generalized heterogeneity model,[13] which addresses stratified heterogeneity in interpolation; and focal-feature regression kriging.[4] A summary of these methods is maintained on the Methods page.

Software

GCF is implemented in open-source software released with the paper. The feature construction and variable selection are provided independently of any learner, so that users may pair the representation with their preferred model.

Web application

GCF Calculator

Runs in the browser without installation. Upload a CSV of coordinates and covariates to generate GCF features and run stability selection.

yongzesong.com/app/gcf/
Source code

GitHub repository

Single-file R implementation with the same function names as the package, an example script and simulated data.

github.com/yongzesong/gcf
Reproduction tutorial

Reproducing GCF

One-command pipeline that re-runs the simulation and rebuilds the published tables and prediction figure.

yongzesong.com/reproduce/gcf.html

Minimal example

library(gcf)
data(sim_grid)   # 30 x 30 grid, 900 rows: y1, x1, x2, x3, x, y

# Steps 1-3a: spatial pattern and neighbourhood distribution features,
# then response-independent functional reduction (paper's simulation settings)
field  <- gcf_field(sim_grid, coords = c("x", "y"), vars = c("x1", "x2", "x3"),
                    buffers = c(2, 4, 6), probs = seq(0, 1, 0.1),
                    d_norm = 4, fine_band = 2, broad_band = 6)

# Step 3b: spatial blocks and stability selection (raw covariates are forced in)
blocks <- gcf_blocks(sim_grid[, c("x", "y")], size = 6)
sel    <- gcf_select(field, y = sim_grid$y1, blocks = blocks)   # B = 80, pi_thr = 0.6

# Step 4: any learner on the selected predictors
train  <- cbind(y1 = sim_grid$y1, field$candidates[, sel$selected])
fit    <- lm(y1 ~ ., data = train)

Call sequence from the package examples; field$candidates holds the reduced candidate set and sel$selected the forced covariates followed by the group representatives.

References

  1. Song, Y. (2026). Generalized covariate field (GCF): spatial-pattern and neighbourhood-distribution feature expansion improves geospatial prediction. International Journal of Geographical Information Science, 40, 1–29. doi:10.1080/13658816.2026.2729719
  2. Meyer, H., & Pebesma, E. (2021). Predicting into unknown space? Estimating the area of applicability of spatial prediction models. Methods in Ecology and Evolution, 12(9), 1620–1633.
  3. Chi, M., et al. (2016). Big data for remote sensing: Challenges and opportunities. Proceedings of the IEEE, 104(11), 2207–2219.
  4. Luo, P., Wu, Y., & Song, Y. (2026). Focal-feature regression kriging. Geographical Analysis, 58(2), e70035.
  5. Song, Y. (2022). The second dimension of spatial association. International Journal of Applied Earth Observation and Geoinformation, 111, 102834.
  6. Zhang, Z., et al. (2023). Geocomplexity explains spatial errors. International Journal of Geographical Information Science, 37(7), 1449–1469.
  7. Ren, K., Song, Y., & Yu, Q. (2026). Second-dimension outliers for spatial prediction. International Journal of Geographical Information Science, 40(6), 1915–1942.
  8. Anselin, L. (1995). Local indicators of spatial association—LISA. Geographical Analysis, 27(2), 93–115.
  9. Wang, J.F., et al. (2010). Geographical detectors-based health risk assessment and its application in the neural tube defects study of the Heshun region, China. International Journal of Geographical Information Science, 24(1), 107–127.
  10. Hopper, S.D., & Gioia, P. (2004). The Southwest Australian Floristic Region: evolution and conservation of a global hot spot of biodiversity. Annual Review of Ecology, Evolution, and Systematics, 35, 623–650.
  11. Mokany, K., et al. (2022). Patterns and drivers of plant diversity across Australia. Ecography, 2022(11), e06426.
  12. Song, Y. (2023). Geographically optimal similarity. Mathematical Geosciences, 55(3), 295–320.
  13. Luo, P., et al. (2023). A generalized heterogeneity model for spatial interpolation. International Journal of Geographical Information Science, 37(3), 634–659.

Citing GCF

@article{song2026gcf,
  title   = {Generalized covariate field ({GCF}): spatial-pattern and neighbourhood-distribution
             feature expansion improves geospatial prediction},
  author  = {Song, Yongze},
  journal = {International Journal of Geographical Information Science},
  volume  = {40},
  pages   = {1--29},
  year    = {2026},
  doi     = {10.1080/13658816.2026.2729719}
}