estimates Ripley's function at radius r for point data pdata.


computes for the point process pproc.


computes for binned data bdata.


generates the function that can be applied repeatedly at different radii r.

Details and Options

  • The product , where is the mean density, gives the expected number of points within distance r of a typical point, not counting the point itself.
  • RipleyK measures spatial homogeneity of a point collection within distance r. In comparing with a Poisson point process, the results are:
  • more dispersed than Poisson
    like Poisson, i.e. complete spatial randomness
    more clustered than Poisson
  • Here, is the volume of a unit ball in .
  • The radius r can be a single value or a list of values. With no radius r specified, RipleyK returns a PointStatisticFunction that can be used to evaluate the function repeatedly.
  • The points pdata can have the following forms:
  • {p1,p2,}points pi
    GeoPosition[],GeoPositionXYZ[],geographic points
    SpatialPointData[]spatial point collection
    {pts,reg}point collection pts and observation region reg
  • If the observation region reg is not given, a region is automatically computed using RipleyRassonRegion.
  • The point process pproc can have the following forms:
  • proca point process proc
    {proc,reg}a point process proc and observation region reg
  • The observation region reg should be a parameter-free SpatialObservationRegionQ.
  • The binned data bdata is from SpatialBinnedPointData and is treated as an InhomogeneousPoissonPointProcess with a piecewise-constant density function.
  • For pdata, is computed by counting distinct pairs of points within distance r of each other.
  • For pproc, is computed by using exact formulas or by simulation to generate point data.
  • The following options can be given:
  • MethodAutomaticwhat methods to use
    SpatialBoundaryCorrectionAutomaticwhat boundary correction to use
  • The following settings can be used for SpatialBoundaryCorrection:
  • Automaticautomatically determined boundary correction
    Noneno boundary correction
    "BorderMargin"use interior margin for observation region
    "Ripley"uses weights depending on the point distance to boundary


open allclose all

Basic Examples  (3)

Estimate Ripley's function at a given radius:

Estimate Ripley's function within a range of distances:

Visualize the result with ListPlot:

Ripley's function of a cluster point process:

Visualize the function with given parameter values:

Scope  (10)

Point Data  (5)

Estimate Ripley's function at distance 0.2:

Obtain empirical estimates of Ripley's function from a list of given distances:

Use RipleyK with SpatialPointData:

Create a PointStatisticFunction for future use:

Find the value of the function at a given radius:

Estimate Ripley's function without explicitly providing the observation region:

Observation region generated by the RipleyRasson estimator:

Estimated function at distance 0.3:

Use RipleyK with GeoPosition:

Plot the point statistics function:

Point Processes  (5)

Ripley's function for PoissonPointProcess has a closed form that does not depend on the intensity:

The function is proportional to :

Ripley's function for a cluster process ThomasPointProcess with specified dimension:

It is always greater than the two-dimensional PoissonPointProcess of the same density:

In 3D:

Compare with the corresponding Poisson point process:

Ripley's function for a cluster process MaternPointProcess with specified dimension:

In 3D:

Ripley's function for a cluster process CauchyPointProcess:

Ripley's function for a cluster process VarianceGammaPointProcess:

Options  (2)

SpatialBoundaryCorrection  (2)

The RipleyK estimator without boundary correction is biased and should not be used unless with a large point set:

The default method "BorderMargin" only considers the points that are distance from the boundary:

The boundary correction method "Ripley" weights each pair of points to make the estimator unbiased:

Compare different edge correction methods:

Estimate the values of Ripley's function with three different methods:

Visualize the results and compare to the theoretical value:

Applications  (6)

Ripley's function is cumulative in the distance and hence monotone increasing:

Ripley's function for complete spatial randomness:

Compute Ripley's function for a few dimensions:

Visualize the results:

Points in a hardcore point process cannot be closer than the hardcore radius :

Estimate the values of Ripley's function:

Visualize the results:

Find hardcore radii estimates for the three samples:

Ripley's of clustered data is higher than complete, spatially random data. Sample from a cluster process:

Generate a control sample from a Poisson point process with the same intensity:

Compare the RipleyK functions:

Earthquakes of magnitude 4 or greater in California for the years 20002015:

Extract the earthquakes' positions:

Compute RipleyK:

Mean point density of the data:

The expected number of earthquakes in within a radius of 2 miles of a typical point in the data:

Use Ripley's function to estimate PairCorrelationG:

Pair correlation from data:

Compute Ripley's function:

Estimate pair correlation:

Compare the estimate with the pair correlation computed from the data:

Properties & Relations  (1)

BesagL is the variance-stabilized RipleyK: , where is Ripley's function, is the spatial dimension and is the volume of a unit ball in :

Compute both statistics:

Check the formula:

Possible Issues  (1)

Empirical RipleyK with border correction may not be increasing (especially for smaller sets):

The uncorrected RipleyK is increasing:

Wolfram Research (2020), RipleyK, Wolfram Language function,


Wolfram Research (2020), RipleyK, Wolfram Language function,


@misc{reference.wolfram_2020_ripleyk, author="Wolfram Research", title="{RipleyK}", year="2020", howpublished="\url{}", note=[Accessed: 15-January-2021 ]}


@online{reference.wolfram_2020_ripleyk, organization={Wolfram Research}, title={RipleyK}, year={2020}, url={}, note=[Accessed: 15-January-2021 ]}


Wolfram Language. 2020. "RipleyK." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2020). RipleyK. Wolfram Language & System Documentation Center. Retrieved from