Quantitative spatial upscaling of categorical information: The multi‐dimensional grid‐point scaling algorithm

Categorical raster datasets often require upscaling to a lower spatial resolution to make them compatible with the scale of ecological analysis. When aggregating categorical data, two critical issues arise: (a) ignoring compositional information present in the high‐resolution grid cells leads to high and uncontrolled loss of information in the scaled dataset; and (b) restricting classes to those present in the high‐resolution dataset assumes validity of the classification scheme at the lower, aggregated resolution. I introduce a new scaling algorithm that aggregates categorical data while simultaneously controlling for information loss by generating a non‐hierarchical, representative, classification system for the aggregated scale. The Multi‐Dimensional Grid‐Point (MDGP) scaling algorithm acknowledges the statistical constraints of compositional count data. In a neutral‐landscape simulation study implementing a full‐factorial design for landscape characteristics, scale factors and algorithm parameters, I evaluated consistency and sensitivity of the scaling algorithm. Consistency and sensitivity were assessed for compositional information retention (IRcmp) and class‐label fidelity (CLF, the probability of recurring scaled class labels) for neutral random landscapes with the same properties. The MDGP‐scaling algorithm consistently preserved information at a significantly higher rate than other commonly used algorithms. Consistency of the algorithm was high for IRcmp and CLF, but coefficients of variation of both metrics across landscapes varied most with class‐abundance distribution. A diminishing return for IRcmp was observed with increasing class‐label precision. Mean class‐label recurrence probability was consistently above 75% for all simulated landscape types, scale factors and class‐label precisions. The MDGP‐scaling algorithm is the first algorithm that generates data‐driven, scale‐specific classification schemes while conducting spatial data aggregation. Consistent gain in IRcmp and the associated reproducibility of classification systems strongly suggest that the increased precision of scaled maps will improve ecological models that rely on upscaling of high‐resolution categorical raster data.


| INTRODUC TI ON
Spatially explicit ecological models rely on spatially exhaustive data layers at appropriate scales for the ecological process of interest (Lam & Quattrochi, 1992;Mas, Gao, & Pacheco, 2010), which often requires scaling datasets to the scale of analysis. Upscaling of raster data to coarser spatial resolutions aggregates data of multiple highresolution grid cells into lower resolution grid cells. As data are aggregated, generalization leads to information loss. Since the goal of data aggregation is to retain sufficient information relevant to a scientific question addressing a phenomenon at the aggregated scale, it is important to quantify the amount of information retained in the aggregated product and to control information loss.
Classification schemes of categorical data are valid for the range of spatial scales for which they were defined. However, commonly applied spatial-aggregation methods majority rule, nearest-neighbor rule, or random rule, or more complex methods such as spatial scan statistic (Coulston, Zaccarelli, Riitters, Koch, & Zurlini, 2014), only consider the original, high-resolution class scheme when assigning class labels to aggregated, larger landscape units. Complex spatial co-occurrence patterns are oversimplified, often resulting in vastly increasing abundance of dominant classes and elimination of rare classes (Gann, Richards, & Biswas, 2012;He, Ventura, & Mladenoff, 2002;Ju, Gopal, & Kolaczyk, 2005). The presumption that the original class descriptors are valid at the aggregated lower resolution, regardless of scale factor, leads to uncontrolled loss of information content in each grid cell of the aggregated map, and potentially to fallacy in ecological models that use the oversimplified aggregated data.
For illustration, consider information loss for a landscape with two cover classes, 'grass' and 'tree' (Figure 1a). Aggregating the landscape subset of 49 grid cells with a class percentage distribution of 73% 'grass' and 27% 'tree' cover into a single coarser resolution cell requires a new class label assignment. The majority rule, a simple plurality decision rule that assigns the output category with the highest proportion of sub-samples (i.e. mode) applies the label 'grass' (Figure 1a). The nearest-neighbour rule assigns the 'tree' class, the category closest to the centre of the scaled grid cell, and the random rule assigns the output class at random (Figure 1a). Application of these three algorithms to the same input data results in completely different class assignments to the up-scaled grid cell, resulting in pure (100% cover) classes of either 'tree' or 'grass'. Assignment to a single class reduces the compositional information content of the aggregated grid K E Y W O R D S categorical raster data, compositional count data, multi-dimensional grid-point, neutral landscape models, scaling algorithm, simplex, simulation, spatial scaling F I G U R E 1 Information loss associated with majority-, nearest-neighbor-and random-rule scaling algorithms. (a) Applying the three algorithms to the two-class ('grass' (G) and 'tree' (T)) landscape example shows that none of the algorithms captures the more intuitive class of 'Woodland' at the aggregation scale. Depending on the algorithm, the amount of compositional information that is lost is either ~27%, if class 'G' is assigned, or ~73%, if class 'T' is assigned. (b) As richness increases, assigning a single input class label to the aggregated output cell represents only one of five original classes that were present, and the maximum compositional information that can be retained is less than 30%. A mixed class label that captures the heterogeneity is required at this scale to represent the landscape. In all three cases, four classes are omitted from the scaled class label. The single-class scaled class label over-represents its class with 100%, when in fact that class was present at only 28.57% for the outcome of the majority rule, 22.45% for the random rule and 10.2% for the nearest-neighbor rule cells to 73% when assigning class 'grass', or to 27% when class 'tree' is assigned. With an increasing number of classes within a sample, compositional information decreases upon aggregation ( Figure 1b).
Subsequently, if the aggregated product is used in combination with remotely sensed data to retrieve biophysical properties of the landscape, for instance biomass, then the biomass estimate will be coarsely over-or underestimated because it is much larger for trees than it is for grass. Magnitudes of error and uncertainty of estimated properties depend on the proportional misrepresentation of the generalized scaled landscape unit, and the difference in biophysical properties of the respective classes that are over-or underrepresented. In the example, to capture the relative abundance of both classes at the scale of lower resolution, a more appropriate class might have been 'Woodland', not a label option, since it did not exist in the original map. To date, no spatial aggregation algorithm generates scale-specific representative classes as landscape units are aggregated.
Species-association patterns, when randomly sampled on a 1-m 2 scale across a defined spatial extent, are expected to differ from the association patterns of the same species on a 50-m 2 scale (O'Neill et al., 1996;Schlup & Wagner, 2008). Consequently, plant communities vary along the continuum of spatial scales and definitions of communities or vegetation classes depend on the scale at which the landscape is sampled. Methods that generate scale-specific classification schemes from samples have to be consistent in delivering class descriptors (labels) that are reproducible and representative for the population, that is, the sampled landscape at the scale of interest (De Cáceres, Font, Vicente, & Oliva, 2009;De Cáceres & Wiser, 2012;Tichý, Chytrý, Hájek, Talbot, & Botta-Dukát, 2010;Tichý, Chytrý, & S̆marda, 2011;Wildi, 2010). The principles of reproducibility and representativeness also apply to scaling methods that aim to generate scale-specific classification schemes, recognizing class co-occurrence variability at different scales. An algorithm that implements scaling of classification schemes preferably also provides a control mechanism for information loss, considering the relative class abundance (composition) and the spatial arrangement (configuration) of sub-samples within samples. The algorithm presented here addresses the compositional information retention aspect.

| Defining the sample space
The sample space of spatially explicit, categorical data is finite and discrete, and samples of local neighborhoods result in count frequencies of classes. Sample space and relative class abundance distributions within samples depend on (a) diversity and spatial characteristics of the landscape and (b) the scale factor. Richness (rch), the number of distinct classes, and evenness, which refers to the class abundance distribution (CAD) across the landscape, define diversity. The spatial distribution patterns of the classes across the landscape range from systematic to random and from highly dispersed to completely aggregated.
Scale factor (sf) is the ratio of the spatial resolution of the scaled grid to the resolution of the original, high-resolution grid; when squared, sf provides the number of sub-units or grid cells within a sample (N smp ). For instance, if the resolution of the original raster is 1 m and the scaled grid resolution is 7 m, the scale factor is 7 and the number of sample sub-units N smp is 49 (sf 2 ).
With sf and rch greater than 1, the number of possible distinct sample outcomes is the number of restricted or weak compositions with binomial coefficients: Since percent-cover per sample is constrained to exactly 100%, the precision (Prc) of relative abundance of class (c) is: For a given sf, as rch increases (Table 1, rows), or for a given rch, as sf increases (Table 1, columns), the number of unique compositions increases rapidly. The precision or granularity of measurement of relative class abundance of a sample is solely determined by sf (Table 1, Equation 2). For a given landscape with a specific rch and scaled with a specific sf, the frequency distribution of each possible composition then depends on CAD and the spatial dispersion or aggregation pattern of the classes across the landscape.
The constraint that the sum of all sample proportions = 1 makes the data compositional in nature (Aitchison, 1986). The sample space of compositional data is called the simplex or S D (Aitchison, 1986).
The constraint of the simplex is that all x i ≥ 0, and that the sum of all x i = 1. When dealing with count compositions (i.e. integers), quantitative grouping or classification methods that use distance metrics from the real space R and that assume multivariate normal distributions are inadequate and lead to spurious statistical results (Aitchison, 1986;van den Boogaart & Tolosana-Delgado, 2008;Jackson, 1997). Proposed solutions for statistical analysis of compositional data are log-ratio transformations of compositional data (Aitchison & Egozcue, 2005;Egozcue, Pawlowsky-Glahn, Mateu-Figueras, & Barceló-Vidal, 2003), which then allow application of analytical methods that are valid in R space. Log-ratio transformation, however, is not defined for count compositions with count zero, and the methods that have been proposed to deal with zero count (1)

| The multi-dimensional grid-point scaling algorithm
The new multi-dimensional grid-points (MDGP) scaling algorithm presented here conducts spatial aggregation of categorical data while simultaneously generating a non-hierarchical, representative classification system for the aggregated scale. The algorithm allows for user-control of information retention while addressing the constraints of the sample space of compositional data with a high probability of zeros in the sample data.  (Table 1).
With increasing scale factor, however, precision of class proportion (the distance between points in the evenly-spaced grid) rapidly increases beyond ecological and, in many cases, statistical significance (Table 1). The MDGP-scaling algorithm limits scaled classlabel precision by implementing a partitioning parameter, which reduces the number of possible grid points (Table in Figure 2). The    (Table). The 1-part precision solutions (first column) are identical to the majorityrule solution with the distance between the three points equal to 100%. Blue box: As richness increases the dimension of the polytope increases. For Richness = 4, grid points are evenly spaced within the 3-simplex (tetrahedron) TA B L E 2 Scaling solutions of example 1 (Figure 1) applying 1-to 5-part output class-label precision solutions. Maximized information retention for each class-label set in bold and maximized IR across all class-label precision solutions in bold red. Classlabel precision of 25% (4-part solution) maximizes compositional information retention for this grid cell and the MDGP algorithm assigns a label nominally representing 75% 'grass' and 25% 'trees' F I G U R E 3 Neutral random landscape of three hypothetical classes (A, B, and C). Class abundance distribution is geometric and spatial aggregation low (h = 0) spatial aggregation. As output class-label precision increases to 33.3% and 20%, the number of realized output classes increases from 3 to 10 and 19 classes for a sf of 5 ( Figure 4) and to 7 and 13 for a sf of 15 ( Figure 5), respectively. The frequency distributions shift from 100% pure classes to a majority of grid cells assigned to mixed-label classes.
As richness increases, the number of possible scaled classes is still very high (Table 3), but many of the classes are expected at low frequencies across the landscape. Hence, to allow for removal of scaled classes with low proportions across the landscape, a threshold parameter for minimum representativeness was implemented.
Output classes that are below the threshold are iteratively removed, The pseudocode for the MDGP-scaling algorithm is presented in Figure 6.
The objective of the following simulation study was to conduct a consistency and sensitivity analysis for the MDGP-scaling algorithm F I G U R E 5 Landscape scaling results for landscape in Figure 3, scaled with a scale factor of 15. Scaled landscape class frequencies (left) and associated maps (right) for label precisions of (a) 100% (1-part; majority rule), (b) 33.3% (3-part), and (c) 20% (5-part). Circle size displays absolute scale of class proportions (Prop_AS) across all plots; colour rendered as relative scale of class proportions (Prop_RS) within each plot. Black dots indicate that the potential grid point was not realized at the aggregated scale. Class labels in the legend of the map as generated by the MDGP-scaling algorithm to evaluate the effects of landscape characteristics, scale factor, and scaled class-label precision on information retention and class representativeness for the larger landscape.

| Test framework
To evaluate consistency and sensitivity of MDGP-scaling, a test framework with a simulation component to generate neutral random landscapes was implemented. The framework (Figure 7) integrates (a) the generation of neutral landscape models, (b) scaling of the landscapes, and (c) evaluation of the scaling results. Testing the performance of algorithms on replicates of simulated complex landscapes with known properties sets the statistical benchmark for applying them to real landscapes (Fahrig, 1991;With & King, 1997). A full factorial design for three levels of rch (3, 6, and 9 classes), two models of CAD (equal and geometric), and four levels of sptAgg (0, 0.3, 0.6, 1) Neutral landscape models were produced for landscapes that resemble distribution patterns that are driven by environmental gradients, one of many pattern types. An algorithm that produces such landscapes is the midpoint-displacement algorithm (Fournier, Fussell, & Carpenter, 1982;Palmer, 1992). The algorithm employed here was the implementation in the Python module 'nlmpy' (Etherington, Holland, & O'Sullivan, 2015).

| MDGP-scaling algorithm consistency and sensitivity to scaling parameters and landscape characteristics
Efficacy of the MDGP-scaling algorithm to increase IR cmp with the increase in class-label precision, was evaluated on the basis of mean IR cmp of all scaled grid cells across the landscape using pairwise-paired Wilcoxon rank-sign tests (Wilcoxon, 1945). Test p-values were adjusted using the Bonferroni correction for multiple comparisons.
Consistency of the algorithm is crucial to build confidence in its application to real landscapes. Consistency was defined as reproducibility of scaling results across different simulated random landscapes that were congruent in the key characteristics of rch, CAD and sptAgg.
It was expected that scaled landscapes originating at arbitrary grid origins of the same original landscape and across replicate landscapes with the same properties display low variability in scaling results. (5) for geometric CAD F I G U R E 7 Schema of framework to test the effects of landscape characteristics, scale factor and class-label precision on information retention, classcount consistency and class-label fidelity in a full factorial design Three indicators that were expected to display low variability are IR cmp , class count (CC) of the scaled classification scheme, and classlabel fidelity (CLF), which is the frequency of class-label recurrences across classification schemes generated at random grid origins.
To evaluate consistency of the algorithm when presented with random variation of landscapes with the same characteristics, consistency of mean IR cmp , CC and CLF were evaluated at the landscape type level with coefficients of variability (CV). An algorithm, robust to random variations of the landscape, is expected to display low CV.
For IR cmp and CC, CV was calculated across the five random scaling results of each of the ten random landscapes per landscape type.
For the five random origins of each landscape, (a) the mean probability of class-label recurrence across all class labels (CLF mnPrb ) and (b) the proportion of classes for which recurrence probability was one (CLF prp1 ) were calculated. High CLF mnPrb and CLF prp1 indicate consistent and reproducible classification schemes. Consistency for the CLF parameters was evaluated with the CV calculated across all landscapes of a landscape type and summarized by landscape type characteristics, scale factors and class-label precisions.
Sensitivity of the MDGP-scaling algorithm to scaling parameters and landscape characteristics was assessed with the magnitude of change for IR cmp and CLF when evaluated by landscape type and sf.
With increasing class-label precision, regardless of landscape type and sf, IR cmp was expected to significantly increase, while CLF was expected to decrease. Significance of differences in IR cmp and CLF between class-label precisions was tested with pairwise-paired Wilcoxon rank-sign tests (Wilcoxon, 1945), and p-values were adjusted using the Bonferroni correction.
Consistency and sensitivity for the three indicators were assessed for four sf and four class-label precisions, ranging from 2-to 5-parts. For the simulation study, the representativeness threshold was maintained constant at 1% and class homogeneity at 90%.

| RE SULTS
Mean IR cmp was significantly higher for class-label precisions of 50% and greater (pairwise-paired Wilcoxon Rank-Sign tests; Bonferroni adjusted p < .001; N = 50; Figure 9). Scale factor had a greater effect on IR cmp for majority-rule aggregated landscapes than MDGP-scaled landscapes for all landscapes regardless of CAD and spatial aggregation factors greater than zero (Figure 9). Difference in IR cmp between MDGP-scaled and majority-rule aggregated landscapes increased with sf for all landscapes and was much greater for landscapes with low sptAgg.

| Algorithm consistency
Consistency of the algorithm was high for IR cmp , CC and CLF.
Landscape-specific coefficient of variation for IR cmp ranged from 0.05% to 5.2%. Consistency of IR cmp was high across all landscape types and scale factors and varied little with scale factor. However, evaluating consistency for individual landscape characteristics showed that CV was almost twice as high for landscapes with equal CAD, and variability increased with richness but decreased with spatial aggregation.

| Algorithm sensitivity
Mean IR cmp increased with increasing class-label precision and decreasing sf for all landscapes (Figure 9). Mean IR cmp was significantly lower (paired Wilcoxon rank-sign test; p < .001) for landscapes with equal CAD than for those with geometric CAD, and it increased with sptAgg and decreased with rch ( Figure 9).
Considering the magnitude of effect, a diminishing return for IR cmp with increasing class-label precision was observed across all landscapes and sf (Figure 9). Largest gains were consistently observed when increasing label precision from 1-part to 2-part solutions (majority-rule or 100% to MDGP-2 or 50% precision). Increase in IR cmp with label precision was reduced as sptAgg increased and was lowest for landscapes with aggregation of one. Largest gains in IR cmp with increasing label precision were observed for landscapes with high rch and for high sf (Figure 9).
Class-label fidelity was high for all landscape types, scale factors and class-label precisions, but decreased with increasing classlabel precisions ( Figure 10). Mean probability of class recurrence for landscapes with equal CAD ranged from 0.99 ± 0.02 for a class-label precision of 50%, decreasing to 0.91 ± 0.1 for a precision of 20%.
For landscapes with geometric CAD, a mean probability reduction of 0.02 ± 0.05 was observed when compared to the corresponding equal CAD landscapes ( Figure 10). With increasing class-label precision, the greatest losses of CLF were observed for fully aggregated landscapes, regardless of rch and CAD. For landscapes with a geometric CAD and low sptAgg, CLF actually increased with classlabel precision as rch increased to nine classes ( Figure 10).

| D ISCUSS I ON
The scale of analysis is crucial when developing ecological models, as results for environmental and ecological processes can vary significantly when evaluated at different scales. Essential components for reliable interpretation of results are selecting the appropriate analytical scale for the ecological processes modelled and providing data with adequate precision to support the models.
The MDGP-scaling algorithm is the first algorithm that generates data-driven, scale-representative classification schemes while conducting spatial data aggregation. The simulation study demonstrated that the algorithm consistently delivers similarly scaled class labels when generating scale-specific classification systems.
Representativeness of generalized data is application-specific.

| Ecological applications
Spatially explicit models of landscape dynamics have their advantages over spatially implicit models (DeAngelis & Yurek, 2017), but they require the detection of spatially explicit change at adequate spatial and temporal resolutions. Detection of changes in land cover and ecosystem properties are common remote sensing applications. Interpretation of changes in spectral-reflectance patterns, as they relate to biophysical parameters of the land surface or as changes in land cover depends on the accurate identification of land cover at the spatial, temporal and thematic precision at which changes are modeled. Landscapes that display high spatial heterogeneity complicate retrieval of biophysical parameters using remotely sensed data (Jacob & Weiss, 2014;Liu, Hiyama, Kimura, & Yamaguchi, 2006;Lu, 2006). For instance, Leaf Area Index (LAI), and Fraction of Photosynthetically Active Radiation (FPAR) are two important biophysical variables in ecosystem productivity models that rely on prior knowledge of land-cover information (Ganguly et al., 2008;Knyazikhin et al., 1999;le Maire, Marsden, Nouvellon, Stape, & Ponzoni, 2012;Steltzer & Welker, 2006;Zhao et al., 2016).
Sensitivity of LAI and FPAR to land-cover and high heterogeneity of vegetation types within a pixel affects LAI estimates in a nonlinear fashion (Garrigues, Allard, Baret, & Weiss, 2006;Lotsch, Tian, Friedl, & Myneni, 2003), and LAI estimate errors at coarse resolution are inversely related to the proportion of the dominant land cover in a pixel (Tian et al., 2002). Consequently, scaling of land cover maps that maintains more precise plant community information reduces error and uncertainty of biophysical parameter estimates from moderate-resolution remotely sensed data.
Another application that requires scaling of land-cover information is modeling land-cover change across long temporal extents.
Since the early 2000s, availability of multi-spectral datasets with high spatial resolution has increased. Modeling spatially explicit and exhaustive changes in the past, however, requires resorting to data with lower spatial resolution. Combining categorical landcover maps derived at different scales requires high spatial resolution products to be scaled to the lower resolution reconciling scaled differences of classification systems. A high priority in this case is to determine class-label precisions at which the low-resolution sensor can spectrally differentiate the most common co-occurrence patterns of mixed classes. Applying the MDGP-scaling algorithm can assist in the optimal class-label precision selection for a variety of F I G U R E 1 0 Sensitivity of class-label fidelity evaluated across all landscape iterations with the same characteristics for five random origins (N = 50) for landscapes with (a) equal and (b) geometric class-abundance distribution (CAD). Richness (rch) increases across columns, while spatial aggregation (sptAgg) increases down rows. MAJ-1 = majority-rule algorithm with 100% class-label precision, MDGP = multidimensional grid-point scaling algorithm with 2 = 50%, 3 = 33%, 4 = 25% and 5 = 20% class-label precision sensors for which larger spatial extents or longer time-series data are available. In a test study, the MDGP-scaling method was applied to scale 2 m resolution plant community maps derived from WorldView-2 data to the 30 m Landsat resolution (Gann, 2018a).
Scaling the original map with a class-label precision of 33% increased IR cmp by 15%, while also increasing class-detection accuracy by 5.2% when compared to majority-rule aggregation. Classification accuracy increased because the mixed classes had more refined class definitions (labels) that translated into more specific multi-spectral reflectance patterns. How scaled maps with higher class-label precision increase accuracy and precision of ecological modeling still needs to be evaluated.

ACK N OWLED G EM ENTS
I am grateful to Jennifer Richards for providing valuable feedback as the research developed. I also thank Cassian D'Cunha for providing technical support with the high-performance data processing.

DATA AVA I L A B I L I T Y S TAT E M E N T
Python and R scripts with documentation are available at https :// doi.org/10.5281/zenodo.3406889 (Gann, 2019). The datasets of neutral landscape models and the scaling results for random origins that were generated and used in the simulation study are available at https ://doi.org/10.5281/zenodo.1400061 (Gann, 2018b).