### Description

This tool calculates basic summary statistics (sum, mean, minimum, maximum, standard deviation, median) of raster values within a circular, roving analysis window. This is similar to what is called ‘zonal statistics’ in some software. The input is a single raster layer representing continuous data (it would not be appropriate to use this command with thematic raster data), and an analysis window radius that is defined in coordinate system units. For a cell to be included in the calculation of the statistics the centre of the cell must fall within the specified distance of the centre of the target cell.

The metrics calculated at the edges of the raster are obviously based on smaller samples than the cells in the interior of the raster (when the analysis window extends beyond the edge of the raster). Similarly, when NoData cells are encontered within the analysis window, they are ignored, and the metrics are calculated on the remaining cells with data values. Although the mean, minimum, maximum and median are probably fairly robust to this reduced sample size issue, it is possible that the standard deviation is underestimated somewhat in these edge cells. The sum metric is the most sensitive to the number of samples, and this metric is adjusted to remove this bias. The observed sum is divided by: the observed number of cells divided by the total number of cells that would have constituted the analysis window had it been complete. This procedure thus normalizes the sum values so that they are comparable across the entire raster.

### Syntax

neighbourhoodstatistics(in, radius, sum, min, max, mean, sd, med, [edge]);

in | the input raster data source | |

radius | the radius of the neighbourhood analysis window in coordinate system units | |

sum | the new output raster data source representing the sum of values in the neighbourhood | |

min | the new output raster data source representing the minimum of values in the neighbourhood | |

max | the new output raster data source representing the maximum of values in the neighbourhood | |

mean | the new output raster data source representing the mean of values in the neighbourhood | |

sd | the new output raster data source representing the standard deviation of values in the neighbourhood | |

med | the new output raster data source representing the median of values in the neighbourhood | |

[edge] | (TRUE/FALSE) calculate statistics for edge cells, where the neighborhood is only partially observed (default=TRUE) |

### Example

neighbourhoodstatistics(in=”C:datadem”, radius=2000, mean=”C:datademmean.img”, sd=”C:datademsd.img”);

neighbourhoodstatistics(in=”C:datahabitat”, radius=250, sum=”C:datahabsum.img”, edge=FALSE);