Background.Cellbased or celllevel metrics for categorical landscape mosaics (i.e., patch mosaics) are computed for each designated focal cell in the grid based a userspecified kernel representing the ecological neighborhood of the focal cell (see below). The model can be parameterized to build kernels for only a subset of focal cells (either userprovided or regularly distributed) or for every cell in an exhaustive moving window approach. Consequently, the celllevel metrics return a unique value to each focal cell, in contrast to the patchlevel metrics that return a unique value to each patch, the classlevel metrics that return a value to each class (patch type), and the landscapelevel metrics that return a single value for the entire landscape mosaic.
Celllevel metrics have the following distinctive characteristics:
 As the name implies, celllevel metrics are focal cellcentric; i.e., they are computed for each focal cell separately and thus return a unique value to each cell in the form of a grid. Celllevel metrics always return a grid rather than a table.
 Celllevel metrics summarize the ecological neighborhood (as defined) of each focal cell without explicit consideration of the explicit patch structure within that neighborhood. In other words, celllevel metrics are agnostic to the explicit structure of the patch mosaic within the ecological neighborhood. Celllevel metrics reflect the composition and configuration of the patch mosaic within the ecological neighborhood, but do so without giving any explicit consideration to the patch structure (or delineation of discrete patches). Instead, celllevel metrics respond to the class values of the individual cells with the ecological neighborhood without consideration of their patch membership. In other words, celllevel metrics summarize the cellular structure of the ecological neighborhood, not the patch structure. For example, the size of patches within the neighborhood may indirectly affect the celllevel metrics, but patch sizes are not explicitly considered in the computations.
 Celllevel metrics typically summarize (but with some exceptions) the ecological neighborhood of each focal cell relative to the patch type (or class) of the focal cell; i.e., the assessed value of a neighboring cell depends on its patch type, but the value assigned is typically relative to the patch type of the focal cell. Thus, the result is returned to the focal cell, not to the class of the focal cell.
Celllevel metrics are computed within a userspecified ecological neighborhood of each focal cell, where the ecological neighborhood is represented either by a standard kernel or resistant kernel, as follows:
 Standard kernel—A standard kernel applied to a grid and centered on a focal cell produces a threedimensional surface representing an estimate of the underlying probability distribution. Here, we can think of the standard kernel as estimating the ecological neighborhood of a focal cell, in which the focal cell has the greatest influence on the neighboring cells in close proximity and the effect decays monotonically with distance. The reverse is also true, neighboring cells in close proximity to the focal cell have the greatest effect on the focal cell and the affect on the focal cell decays monotonically with distance. Thus, the focal cell can be envisioned as affecting the neighborhood and, conversely, the neighborhood can be envisioned as affecting the focal cell. Importantly, there are myriad possible kernel forms representing different probability distributions. Each kernel form has a different shape and the chosen form should ideally represent the ecological process under consideration. For example, if the ecological flow outward from the focal cell decays rapidly right from the start, a negative exponential distribution might be the ideal kernel form. However, if the decay is slow at first and then rapidly increases, a Gaussian (or bellshaped) distribution might be the ideal kernel form.
The shape of the kernel is a function of the chosen probability distribution (Fig. 1), but the size or spread of the kernel is a function of its bandwidth. Each probability distribution has a parameter that determines how far the kernel extends from the focal cell, and we call this parameter the “bandwidth”. The bandwidth for a Gaussian kernel, for example, is given by the standard deviation parameter and it gives the distance from the focal cell that captures roughly 68% of the kernel volume. The bandwidth for a Linear kernel is given by the distance from the focal cell at which the probability reaches zero, and thus it defines the maximum spread of the kernel. The bandwidth for an Exponential kernel is given by the distance from the focal cell at which 50% of the distribution lies to the left (i.e., the median, or the distance at which 50% of the kernel volume is captured). Importantly, each kernel form has a bandwidth parameter but its meaning differs among kernel forms, and thus it is important to understand the kernel form and its associated bandwidth parameter before parameterizing the model.
Figure 1. Illustration of a standard (i.e., nonresistant) kernel based on: 1) Gaussian distribution, 2) linear distribution, and 3) exponential distribution. The kernels shown here in 2 dimensional are implemented in 3 dimensions on the raster, such that the peak of the kernel is centered on the focal cell and the kernel value decreases monotonically with increasing distance from the focal cell.
FRAGSTATS implements standard kernels, defined by the combination of kernel shape and bandwidth, in celllevel metrics as a means of defining the ecological neighborhood of a focal cell, but instead of making the kernel a true probability distribution, in which the volume equals 1, we set the maximum kernel value to be 1 at the focal cell and let neighboring cell values decrease according to the selected kernel form and bandwidth until the kernel values approach or reach zero. In some cases, such as with a Gaussian and Exponential kernel, we truncate the kernel when the values get close to zero, because in both the Gaussian and Exponential distributions the values only asymptotically approach zero (Fig. 1). In the case of the Gaussian kernel, we truncate the kernel at 3 times the bandwidth, which captures roughly 99.8% of the full kernel volume. In the case of the Exponential kernel, we truncate the kernel at a distance that captures 99% of the full kernel volume.
The algorithm for a standard kernel is described below for a resistant kernel, the difference being that in a standard kernel the resistance is set to 1 for every cell. Thus, a standard kernel is identical to a resistant kernel built in a nonresistant landscape.
 Resistant kernel—A resistant kernel, introduced by Compton et al. (2007), is a hybrid between the standard kernel estimator described above and leastcost paths based on resistant surfaces (also referred to as cost surfaces). In wildlife applications, for example, resistant surfaces are replacing the binary habitat/nonhabitat classifications of island biogeography and classic metapopulation models with a more nuanced approach that represents variation in habitat quality (e.g., Ricketts 2001). In a patch mosaic, a resistance value (or cost) is assigned to each patch type, typically representing a divisor of the expected rate of ecological flow (e.g., dispersing or migrating animals) through a patch type. For example, a forestdependent organism might have a high rate of flow (and thus low resistance) through forest, but a low rate of flow (and thus high resistance) through highdensity development. In this case, the cost assigned to each patch type in the resistant surface may represent the willingness of the organism to cross the patch type, the physiological cost of moving through the patch type, the reduction in survival for the organism moving through the patch type, or an integration of all these factors. Empirical data on costs are often lacking, but can be derived from a variety of data sources, including location, movement and/or genetic data for the organism (or process) under consideration.
Traditional leastcost path analysis finds the shortest functional distance between two points based on the resistant surface. The cost distance (or functional distance) between two points along any particular pathway is equal to the cumulative cost of moving through the associated cells. Leastcost path analysis finds the path with the least total cost. This leastcost path approach can be extended to a multidirectional approach that measures the functional distance (or leastcost path distance) from a focal cell to every other cell in the landscape. In the resistant kernel estimator, the complement of leastcost path distance (a.k.a. functional proximity; see below) to each cell from the focal cell is multiplied by a weight reflecting the shape and width of the standard kernel. The result is a resistant kernel that depicts the functional ecological neighborhood of the focal cell. In essence, the standard kernel is an estimate of the fundamental ecological neighborhood and is appropriate when resistant to movement is irrelevant (e.g., highly vagile species in a wildlife application), while the resistant kernel is an estimate of the realized ecological neighborhood when resistance to movement is relevant.
FRAGSTATS implements resistant kernels, defined by the combination of kernel shape and bandwidth along with a resistant surface, in celllevel metrics as a means of defining the ecological neighborhood of a focal cell for ecological processes in which resistance to flow is relevant. As with the standard kernel, we set the maximum kernel value to be 1 at the focal cell and let neighboring cell values decrease according to the selected kernel form and bandwidth in combination with resistance until the kernel values approach zero. Likewise, we truncate the kernel as appropriate based on the chosen kernel form.
The resistant kernel algorithm is implemented as follows, and illustrated in figure 1 below:
 First, assign a cost to each cell (Fig. 2B). Cost represents the relative cost of moving through a neighboring cell from the focal cell. The minimum cost is 1 and the maximum is unbounded, but represents how many times more costly it is relative to the minimum. Thus, if the least costly class to move through has a cost of 1 and another class is 10 times more costly to move through, it is assigned a cost of 10. There are two options for specifying costs:

 Resistance table—supply a resistance or cost table, which gives the relative cost of moving through each patch type from an initial patch type, and it need not be symmetrical, as described below. FRAGSTATS uses the file extension .fsq for resistance files and will look for files with this extension by default when navigating. The .fsq extension is not mandatory, but using it can help keep files organized. The syntax for this commadelimited ASCII file is as follows:
FSQ_TABLE
CLASS_LIST_LITERAL(1stClassName, 2ndClassName, etc.)
CLASS_LIST_NUMERIC(1stClassID, 2ndClassID, etc.)
From Class1 to Class1, From Class1 to Class 2, etc.
From Class2 to Class1, From Class2 to Class 2, etc. Etc.

 Comment lines start with # and are allowed anywhere in the table.
 FSQ_TABLE must be specified in the first line.
 Two types of class lists are allowed CLASS_LIST_LITERAL() and CLASS_LIST_NUMERIC(), but only the first one encountered is considered, so you only need one of these lines.
 Literal class names (1stClassName, 2ndClassName, etc.,) are character strings and cannot contain spaces.
 Class Ids (1stClassID, 2ndClassID, etc.) are integer values corresponding to class values in the grid.
 With regards to resistance or costs, the order of rows and columns is the one specified in the CLASS_LIST_LITERAL() or CLASS_LIST_NUMERIC(), whichever comes first. From Class i to Class j is an integer value giving the relative cost of moving from a cell of class i to a cell of class j .
 Costs must be given as integers 1 or greater. For example, given five classes, the following file would be suitable:
FSQ_TABLE
CLASS_LIST_NUMERIC(2, 3, 4, 5, 6)
1, 30, 30, 30, 30
70, 1, 40, 40, 40
30, 40, 1, 50, 50
30, 40, 50, 1, 60
30, 40, 50, 60, 1

 The cost entries must be a square matrix (i.e., same number of rows and columns), must have the same list and order of ClassIDs as given in the CLASS_LIST_LITERAL or CLASS_LIST_NUMERIC, should contain a record for each unique pairwise combination of patch types (classes) in the input landscape (any missing class must be missing in both the rows and columns and will be assigned a cost equal to the user specified bank account, which equates to functioning as a barrier to flows), and all arguments should be separated by a comma.
 The cost matrix can be asymmetrical; that is, upper right and lower left triangles do not need to mirror each other. Accordingly, it is important to realize that the rows represent the focal class and the columns represent the adjacent or abutting class. Let's consider the costs focal class A (or ID=2) in the example above, given in the first row of the cost matrix. An adjacent patch of class B (or ID=3) has a cost of 30; i.e., it is 30 times more costly to flow through a cell of class B than the minimum. Conversely, the cost of moving from a cell of class B through a cell of class A is 70 times the minimum (row 2, column 1). This asymmetry may be important in some applications; for example, an animal may find it very costly to move from a closedcanopy forest through an open area, whereas, the reverse may not be true.
 The diagonals are typically given a cost of 1 (i.e., the cost of moving from a cell of a particular class through a cell of that same class is the minimum), but it is possible to specify a nonzero diagonal. For example, if one wants to specify constant costs for each patch type regardless of the class of the from cell, then each row would be identical so that the costs of moving through cells of each class are the same regardless of the source cells.
 If the input landscape has background (not the same as nodata), you need to include the background class value specified in the grid properties during data import, otherwise all background cells will be given a cost equal to the userspecified bank account and thus effectively serve as a barrier to flow.
 This table can be created and managed using any text editor and then simply saved as a comma delimited file (.csv).
 There are two common scenarios for parameterizing the cost matrics. In the first scenario, the cost of moving through a cell of a particular class is treated the same regardless of the focal cell class. In other words, the class of the focal cell doesn’t affect the cost of moving through cells of each class. In this scenario, the rows of the matrix are given the same value within each column. Thus, regardless of the “from” cell (i.e., the focal cell) the “to” cell cost is the same. The following cost table is an example of this scenarios:
FSQ_TABLE
CLASS_LIST_NUMERIC(2, 3, 4, 5, 6)
10, 30, 40, 1, 3
10, 30, 40, 1, 3
10, 30, 40, 1, 3
10, 30, 40, 1, 3
10, 30, 40, 1, 3

 In the second scenario, the cost of moving through a cell of a particular class varies depending on the focal cell class. In other words, the class of the focal cell determines the cost of moving through cells of each class; i.e., costs are all relative to the focal cell class. In this scenario, the diagonal elements of the matrix are logically set to one, but the offdiagonals can take on any value greater than one, and the matrix can be symmetric or asymmetric depending on the ecological process being represented. The following cost table is an example of this scenarios:
FSQ_TABLE
CLASS_LIST_NUMERIC(2, 3, 4, 5, 6)
1, 30, 40, 1, 3
30, 1, 40, 1, 3
40, 30, 1, 1, 3
1, 30, 40, 1, 3
3, 30, 40, 1, 1

 Resistance grid—supply a resistance grid, which gives the relative cost of moving through each cell. Note, in contrast to the resistance table in which the costs are assigned based on patch type, the resistance grid can take on any cost values independent of the corresponding patch type. Thus, the use of a resistance grid affords the user complete flexibility in defining costs.
 Next, for a focal cell generate a resistant (or cost) surface by assigning the relevant cost to each cell within the kernel window based on the resistance table (Fig. 2C) or, alternatively, simply adopt the usersupplied resistance grid. For example, the focal cell in figure 2C is of patch type A, so the costs assigned to each cell is based on the information in the first row of the cost matrix corresponding to "from" patch type A. Note, in this scenario, the resistant surface will change depending on the patch type of the focal cell.
 Next, define the kernel. Specifically, select the standard kernel shape and size. Currently, the only kernel shape option is Gaussian (i.e., bellshaped), but ultimately, we will add other standard kernel shapes (e.g., linear, negative exponential) as well as an option for a usersupplied custom kernel either in the form of a usersupplied probability density function or a supplied raster. The kernel size is given by a userspecified bandwidth (h), where the meaning of the bandwidth varies depending on the kernel shape. For a Gaussian kernel, the bandwidth is equal to the standard deviation and thus captures roughly 68% of the kernel volume.
 Next, assign to the focal cell a "bank account" (b) based on the userspecified bandwidth (h) of the standard kernel. For illustrative purposes, let's say that the grid cell size in figure 2 is 10 m and we wish to create a resistant Gaussian kernel with a bandwidth h (equal to one standard deviation) of 30 m (three cells). Further, let's say that we want the Gaussian kernel to extend outward to no more three standard deviations (3h; 90 m or nine cells), since beyond that distance the landscape has only a trivial influence on the focal cell, and vice versa. Given these parameters, we start with a bank account of nine, since at the minimum cost of one of moving through a single cell, the kernel will extend outward nine cells.
For Gaussian kernel: b = (3×h) / cell size
where: b = bank account, given as the kernel window radius in number of cells
h = bandwidth, given in meters
 Next, for a focal cell, spread outward to adjacent cells iteratively, depleting the bank account at each step by the cost of spreading to each cell (Fig. 2D) until the bank account is depleted and a periphery of cells with a zero bank account is realized. Spread no further beyond this periphery of zerovalued cells. In this example, starting with a bank account of 9 in the focal cell, if we move to an adjacent cell of patch type F (cost of 10, Fig. 2B), we reduce the bank account by 10 and assign a balance of 0 (since negative accounts are not allowed) to the adjacent cell. This means that we use up our entire bank account if we attempt to move through a cell of patch type F and can spread no further from that cell. On the other hand, if we move to an adjacent cell of patch type A (cost of 1; Fig. 2B), we reduce the bank account by 1 and assign a balance of 8 to the adjacent cell. For simplicity in this illustration, diagonal paths are treated the same as orthogonal paths, but in the model, diagonal costs are multiplied by . This process is repeated iteratively, spreading outward in turn from each visited cell, each time finding the least cost of getting to that cell from any of its neighbors, until the balance reaches zero in all directions. This produces a functional proximity surface representing the proximity (p) of every cell to the focal cell within a threshold proximity distance. Note the difference between functional proximity and least cost path distance. Functional proximity decreases as you move away from the focal cell, whereas leastcost path distance increases  they are complementary measures of distance. In addition, note that the proximity surface has embedded within it the least cost path to each cell.
 Next, based on the specified kernel function, transform the proximity values (p) into number of bandwidths (w) from the focal cell. For example, for a Gaussian kernel, transform the proximity values into number of standard deviation units from the focal cell, such that in our example, a proximity value of 9 (at the focal cell) is equal to 0 and a proximity value of 0 (cells at the periphery of the kernel) is equal to 3, as follows:
w_{ij} = (b  p_{ij}) / (h/cell size)
where: w_{ij} = number of bandwidths of window cell j from focal cell i
p_{ij }= proximity value of widow window cell j from focal cell i
b = bank account, given as the kernel window radius in number of cells
h = bandwidth given in meters
 Next, based on the specified kernel function, compute the kernel density for the value derived above for each cell in the window. For example, for a Gaussian kernel, compute the kernel density for each value based on a normal distribution with a height of 1 (at the focal cell), mean of 0 (centered on the focal cell) and standard deviation of 1 (Fig. 2E), as follows:
d_{ij} = exp((w_{ij}^2)/2))
where: d_{ij} = kernel density of window cell j from focal cell i
w_{ij} = number of bandwidths of window cell j from focal cell i
For example, for the focal cell i, d_{ij} = 1; for window cell with w_{ij} = 1, d_{ij} = 0.6065307
Figure 2. Illustration of a resistant kernel. Beginning with a patch mosaic (A), a userspecified cost matrix is developed (B) that represents the relative cost of moving through each patch type (columns) from an initial patch type (rows). The cost of moving through the same patch type (diagonal elements) is always set to the minimum value of one, and the matrix need not be symmetrical. For the focal cell (bold cell in the center), a resistant (or cost) surface is generated by applying the corresponding costs to each neighboring cell (C). Next, assign to the focal cell a "bank account" based on the width of the standard kernel, and spread outward to adjacent cells iteratively, depleting the bank account at each step by the minimum cost of spreading to each cell (see text for details); the result is a functional proximity surface (D), which has embedded within it the least cost path to each cell from the focal cell (indicated by tracing the arrows backwards from each cell to the focal cell). Lastly, multiply the cell values in the proximity surface by weights derived from the specified kernel function (see text for details); the result is a resistant kernel for the focal cell (E).
Limitations.—The limitations of cellbased metrics are largely due to the challenges of choosing a kernel form and size to represent the ecological process under consideration and, in the case of resistant kernels, deriving meaningful resistance or cost values. Clearly, each ecological process can have a different ecological neighborhood, and thus choosing the mathematical form and size of the kernel to represent that neighborhood can be extremely challenging. Similarly, resistance or costs can assume a variety of meanings for different ecological processes, and thus specifying costs is equally fraught with challenges. It is imperative that the choices of kernel form and size and resistance values reflect the ecological process under consideration. Under most circumstances, for example, it is probably not valid to assume that all patch types confer the same level of resistance to any ecological flow under consideration. Often there will not be a strong empirical basis for establishing a resistance valuation scheme, but a reasoned guess based on a theoretical understanding of the phenomenon is probably better than assuming all costs are the same. For example, from the perspective of a closedcanopy forest specialist, we might assign resistance or costs somewhat subjectively according to the degree of canopy closure. Careful consideration should be given to devising a scheme that reflect any empirical and theoretical knowledge and understanding of the process under consideration. If the scheme does not accurately represent the process under consideration, then the results will be spurious.