Estimating the density of a point pattern and thereby simulating a point pattern with reference to the obtained density utilizing the ‘spatstat’ package
- 32-bit version required for ArcMap, 64-bit version required for ArcGIS Pro (Note: the installer installs both by default).
- 64-bit version can be used with ArcMap by installing Background Geoprocessing and configuring scripts to run in the background.
- In the Catalog window, navigate to the folder containing the Python Toolbox, R Integration.pyt. Note: You may have to first add a folder connection to the location that you extracted the files or downloaded via GitHub.
- Open the toolbox, which should look like this:
- Run the Install R bindings script. You can then test that the bridge is able to see your R installation by running the Print R Version and R Installation Details tools.
#####ArcGIS Pro 1.1
- In the Project pane, either navigate to a folder connection containing the Python toolbox, or right click on Toolboxes > Add Toolbox and navigate to the location of the Python toolbox.
- Open the toolbox, which should look like this:
-Run the Install R bindings script. You can then test that the bridge is able to see your R installation by running the Print R Version and R Installation Details tools.
###Method Point pattern analysis (PPA) is the study of the spatial arrangements of points in (usually 2-dimensional) space. A point pattern is a datatype that is converted from a input point feature that can then be utilised for several analyses. The foremost part of point pattern is its density estimation.
kernel density estimation (KDE) is a non-parametric way to estimate the probability density function of a random variable. Kernel density estimation is a fundamental data smoothing problem where inferences about the population are made, based on a finite data sample. The kernel smoothed intensity function can be used to estimated kernel density in R.
The 'ppm' (point pattern model) is a function that fits the model for the point pattern with the estimated density and helps in simulating another point pattern according to the generated density using the function 'simulate'.
###Data The data used here in this example case is Meuse river data. Meuse dataset comprises the measures of four major heavy metals found in the top soil in a flood plain along the river Meuse, Belgium. This is crucial that the contamination happens just because of the river flow that moves the polluted sediments and deposits close to the river bank. This case makes it explicit for geostatistical analysis of the dataset.
###R-Package Package ‘spatstat’ is used here in conjunction with the package ‘sp’. 'spatstat’ promotes a range of statistical analyses of spatial data and mainly focuses on the analysis of spatial patterns of points in two-dimensional space. The points my carry auxiliart data and the spatial region in which the points were recorded may have arbitrary shape. It is designed to support a complete statistical analysis of spatial data. The ‘sp’ helps with class descriptions and methods for importing , exporting and visualizing spatial data.
###How to use ####Point pattern analysis In order to use this tool, select the PointPat script tool from the Interp_simul_tools.tbx toolbox in the ArcGIS environment. As you proceed, you will find this tool popped up as shown below in Figure:1.
The description of each of the parameters found in this pop-up tool is as follow.
- Input feature : Input point feature containing few or several fields on a specific theme.
- Input boundary : Input boundary spatial polygon that acts as an observation window for the estimated density. This is optional.
- Band width for the density : The value for the sigma - the band width to estimate the density of the pattern pattern. (default value is given as 70)
- Output density : The estimated density of the point pattern obtained from the given input feature dataset.
- Output simulation : The simulated point pattern with reference to the generated density from the given input feature dataset.
#####Steps to use the tool :
- The feature layers of meuse dataset is provided in this same repository within the data folder.
- Click the Input feature file icon and browse for the meuse feature class from meuse.gdb.
- Click the Input boundary file icon and browse for the meuse_area feature class from meuse.gdb.
- There is a default value (70) for the third parameter i.e. Band width for the density. If needed to change the value, enter the new value for the sigma band width.
- Give output files for Output density and Output simulation if you want to change the default file selects. Finally click OK.
Once the input is given, the tool runs point pattern estimation of density and simulation as shown below in Figure:2 and produces the output density and simulation of points as a shapefile as shown in Figure:3.
###References  Baddeley, Adrian, et al. "Package ‘spatstat’." (2015).
 Kernel smoothed internsity function - Density estimation using spatstat.
 Fitting the Point pattern model using spatstat.