Is there a tool similar to the Average Nearest Neighbor tool where instead of calculating the average for the closest point it calculates the average for the closest X points?


Yes, you should use the Generate Near Table tool. Your in_feature is the points feature you want to analyze. Your near_feature is the points feature close/surrounding the point to analyze. You must specify how far you want to limit the near table. As a result you will have a table with the distance values from the point you want to evaluate to the n points that you are interested. You can use any pivot table (excel works fine), or if you want more automated results you can use cursors to calculate the average distance. Hope this helps.

Uncheck the box Find only closest feature (optional) then enter the number of features to find in Maximum number of closest matches (optional).

enter image description here

This will generate a table that has a NEAR_RANK attribute you can query to get the values you need.

enter image description here

| improve this answer | |
  • Does this tool work for the same feature class? It looks like it only works for two different feature classes. – chaptuck Jun 2 '16 at 19:42
  • Never tryied for the same feature class. However, you can duplicate your fc and make one the in feature and the other one the 'near' one. Wil work great. – Delonix R. Jun 3 '16 at 0:10
  • @TuckerChapman... did it work? – Delonix R. Jun 3 '16 at 15:50
  • 1
    Yes it did. Thank you! I added a few images to your answer of what I did. – chaptuck Jun 3 '16 at 21:38

Sorry, but you are profoundly misunderstanding the tool/statistic. The nearest neighbor index (NNI) is a statistic for evaluating the spatial distribution of point observations, as to whether they are random or clustered.

This is one of the simplest indices in a family of statistics called Point Patten Analysis (PPA). The NNI tests the observed average neighbor distance against the expected and is not limited to a single neighbor, as you intimate. In fact, the average neighbor distance is calculated from a matrix of all pair-wise distances.

The Nearest Neighbor Index is calculated as:

Nearest Neighbor Distance (observed) D(nn) = sum(min(Dij)/N)

Mean Random Distance (expected) D(e) = 0.5 SQRT(A/N)

Nearest Neighbor Index NNI = D(nn)/D(e)

Where; D=matrix of neighbor distances, A=Area, N=number of observations`
| improve this answer | |
  • I understand that but what I was wondering is if there is a tool that can calculate the "group-wise" distance for every point finding the minimal distance required for X points from a point and averaging that instead of 1 point and its closest neighbor (for each point). – chaptuck Jun 2 '16 at 17:57
  • To what end? In this instance, the expected would be incorrect and yield an erroneous result. It sounds like you are describing the Ripley's-K statistic that calculates clustering a specified spatial (distance) lags. I believe that this statistic is available in ArcGIS under the spatial statistics toolbox "Multi-Distance Spatial Cluster Analysis " tool. Unfortunately, the commonly applied statistic, Besag's-L (standardizes the expected of K to zero, making it considerably more interpretable), is not available in ArcGIS and there is no simulation envelope to indicate statistical significance. – Jeffrey Evans Jun 2 '16 at 18:16
  • I would also add that if your spatial process is inhomogeneous, as many are, then statistics based on kNN can be very misleading, particularly if spatial lags are introduced. Please delve into the primary literature, which is quite voluminous, on point pattern analysis and quantifying spatial process. There has been considerable progress, in spatial statistics, using intensity to normalize inhomogeneity and nonstationarity in spatial random fields. – Jeffrey Evans Jun 2 '16 at 18:23
  • I am trying to calculate values for the search radius in the Empirical Bayesian Kriging tool. According to this post the Geostatistical Wizard sets it to search for at least 32 neighbors. I want to try different values and was wondering if there was a tool to calculate those distances for N neighbors instead of 1. – chaptuck Jun 2 '16 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.