RipleyK
✖
RipleyK
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:
-
proc a 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:
-
Method Automatic what methods to use SpatialBoundaryCorrection Automatic what boundary correction to use - The following settings can be used for SpatialBoundaryCorrection:
-
Automatic automatically determined boundary correction None no boundary correction "BorderMargin" use interior margin for observation region "Ripley" uses weights depending on the point distance to boundary
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Estimate Ripley's function at a given radius:

https://wolfram.com/xid/0btn6u8fgphe-7xwnvr

https://wolfram.com/xid/0btn6u8fgphe-4wykf

Estimate Ripley's function within a range of distances:

https://wolfram.com/xid/0btn6u8fgphe-6p0x9e


https://wolfram.com/xid/0btn6u8fgphe-sezo3

https://wolfram.com/xid/0btn6u8fgphe-kknpl5
Visualize the result with ListPlot:

https://wolfram.com/xid/0btn6u8fgphe-ef5jdl

Ripley's function of a cluster point process:

https://wolfram.com/xid/0btn6u8fgphe-0puauw

Visualize the function with given parameter values:

https://wolfram.com/xid/0btn6u8fgphe-daj61m

Scope (10)Survey of the scope of standard use cases
Point Data (5)
Estimate Ripley's function at distance 0.2:

https://wolfram.com/xid/0btn6u8fgphe-e2gx6r

https://wolfram.com/xid/0btn6u8fgphe-bf4bxp

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

https://wolfram.com/xid/0btn6u8fgphe-kyzwq

Use RipleyK with SpatialPointData:

https://wolfram.com/xid/0btn6u8fgphe-c48w4w


https://wolfram.com/xid/0btn6u8fgphe-g7lbop

Create a PointStatisticFunction for future use:

https://wolfram.com/xid/0btn6u8fgphe-js3gk8

https://wolfram.com/xid/0btn6u8fgphe-odkmbl

Find the value of the function at a given radius:

https://wolfram.com/xid/0btn6u8fgphe-vx5qgr

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

https://wolfram.com/xid/0btn6u8fgphe-f7t1ko

https://wolfram.com/xid/0btn6u8fgphe-7rwaj3

Observation region generated by the Ripley–Rasson estimator:

https://wolfram.com/xid/0btn6u8fgphe-hc1hyh

Estimated function at distance 0.3:

https://wolfram.com/xid/0btn6u8fgphe-h12d14

Use RipleyK with GeoPosition:

https://wolfram.com/xid/0btn6u8fgphe-1vo729


https://wolfram.com/xid/0btn6u8fgphe-xpkh6o

Plot the point statistics function:

https://wolfram.com/xid/0btn6u8fgphe-7m1ksc

Point Processes (5)
Ripley's function for PoissonPointProcess has a closed form that does not depend on the intensity:

https://wolfram.com/xid/0btn6u8fgphe-3hltk1

https://wolfram.com/xid/0btn6u8fgphe-m6387j

The function is proportional to :

https://wolfram.com/xid/0btn6u8fgphe-8g4nyq

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

https://wolfram.com/xid/0btn6u8fgphe-7ib6aq

https://wolfram.com/xid/0btn6u8fgphe-qpvl0c

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

https://wolfram.com/xid/0btn6u8fgphe-7fxefx


https://wolfram.com/xid/0btn6u8fgphe-0utcju


https://wolfram.com/xid/0btn6u8fgphe-sehhpq

https://wolfram.com/xid/0btn6u8fgphe-kghzua

Compare with the corresponding Poisson point process:

https://wolfram.com/xid/0btn6u8fgphe-jna70l


https://wolfram.com/xid/0btn6u8fgphe-mqowd

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

https://wolfram.com/xid/0btn6u8fgphe-oi9wov

https://wolfram.com/xid/0btn6u8fgphe-ofqh4k


https://wolfram.com/xid/0btn6u8fgphe-yqw7j7

https://wolfram.com/xid/0btn6u8fgphe-1q0vyt

Ripley's function for a cluster process CauchyPointProcess:

https://wolfram.com/xid/0btn6u8fgphe-td7557

https://wolfram.com/xid/0btn6u8fgphe-g2fzj0

Ripley's function for a cluster process VarianceGammaPointProcess:

https://wolfram.com/xid/0btn6u8fgphe-x1xqiz

https://wolfram.com/xid/0btn6u8fgphe-2cthww

Options (2)Common values & functionality for each option
SpatialBoundaryCorrection (2)
The RipleyK estimator without boundary correction is biased and should not be used unless with a large point set:

https://wolfram.com/xid/0btn6u8fgphe-ch7be2

https://wolfram.com/xid/0btn6u8fgphe-ds1aaa

https://wolfram.com/xid/0btn6u8fgphe-88aqlu

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

https://wolfram.com/xid/0btn6u8fgphe-g1v0t0


https://wolfram.com/xid/0btn6u8fgphe-eholvz

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

https://wolfram.com/xid/0btn6u8fgphe-dlt8hb

Compare different edge correction methods:

https://wolfram.com/xid/0btn6u8fgphe-cse7si
Estimate the values of Ripley's function with three different methods:

https://wolfram.com/xid/0btn6u8fgphe-ihhmaw

https://wolfram.com/xid/0btn6u8fgphe-lflu49
Visualize the results and compare to the theoretical value:

https://wolfram.com/xid/0btn6u8fgphe-y0awku


https://wolfram.com/xid/0btn6u8fgphe-pw5mgr

Applications (6)Sample problems that can be solved with this function
Ripley's function is cumulative in the distance and hence monotone increasing:

https://wolfram.com/xid/0btn6u8fgphe-b46qiv

https://wolfram.com/xid/0btn6u8fgphe-2cenh1


https://wolfram.com/xid/0btn6u8fgphe-l40i3k

Ripley's function for complete spatial randomness:

https://wolfram.com/xid/0btn6u8fgphe-kinnz
Compute Ripley's function for a few dimensions:

https://wolfram.com/xid/0btn6u8fgphe-dbm3in

https://wolfram.com/xid/0btn6u8fgphe-hsw68q

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

https://wolfram.com/xid/0btn6u8fgphe-887yj9

https://wolfram.com/xid/0btn6u8fgphe-lj8rzu

Estimate the values of Ripley's function:

https://wolfram.com/xid/0btn6u8fgphe-c3jnbl

https://wolfram.com/xid/0btn6u8fgphe-o9l70r

Find hardcore radii estimates for the three samples:

https://wolfram.com/xid/0btn6u8fgphe-301t76

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

https://wolfram.com/xid/0btn6u8fgphe-bpafvv
Generate a control sample from a Poisson point process with the same intensity:

https://wolfram.com/xid/0btn6u8fgphe-cn3kgx

https://wolfram.com/xid/0btn6u8fgphe-baqyty

Compare the RipleyK functions:

https://wolfram.com/xid/0btn6u8fgphe-ultu1

https://wolfram.com/xid/0btn6u8fgphe-kvvrg8

Earthquakes of magnitude 4 or greater in California for the years 2000–2015:

https://wolfram.com/xid/0btn6u8fgphe-g9myqh

https://wolfram.com/xid/0btn6u8fgphe-0jjm5q

Extract the earthquakes' positions:

https://wolfram.com/xid/0btn6u8fgphe-rs8dbf
Compute RipleyK:

https://wolfram.com/xid/0btn6u8fgphe-ma1dze

Mean point density of the data:

https://wolfram.com/xid/0btn6u8fgphe-wvq11l
The expected number of earthquakes in within a radius of 2 miles of a typical point in the data:

https://wolfram.com/xid/0btn6u8fgphe-2hahxk

Use Ripley's function to estimate PairCorrelationG:

https://wolfram.com/xid/0btn6u8fgphe-b7gwyb

https://wolfram.com/xid/0btn6u8fgphe-m1i3f5

https://wolfram.com/xid/0btn6u8fgphe-5kciue

https://wolfram.com/xid/0btn6u8fgphe-g5qjzu


https://wolfram.com/xid/0btn6u8fgphe-2j0s8j
Compare the estimate with the pair correlation computed from the data:

https://wolfram.com/xid/0btn6u8fgphe-m3yi06

Properties & Relations (1)Properties of the function, and connections to other functions
BesagL is the variance-stabilized RipleyK: , where
is Ripley's
function,
is the spatial dimension and
is the volume of a unit ball in
:

https://wolfram.com/xid/0btn6u8fgphe-dcqx9o

https://wolfram.com/xid/0btn6u8fgphe-dau18n

https://wolfram.com/xid/0btn6u8fgphe-ww6824

Possible Issues (1)Common pitfalls and unexpected behavior
Empirical RipleyK with border correction may not be increasing (especially for smaller sets):

https://wolfram.com/xid/0btn6u8fgphe-murbz9

https://wolfram.com/xid/0btn6u8fgphe-iu66tv

The uncorrected RipleyK is increasing:

https://wolfram.com/xid/0btn6u8fgphe-oy3eb9

Wolfram Research (2020), RipleyK, Wolfram Language function, https://reference.wolfram.com/language/ref/RipleyK.html.
Text
Wolfram Research (2020), RipleyK, Wolfram Language function, https://reference.wolfram.com/language/ref/RipleyK.html.
Wolfram Research (2020), RipleyK, Wolfram Language function, https://reference.wolfram.com/language/ref/RipleyK.html.
CMS
Wolfram Language. 2020. "RipleyK." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RipleyK.html.
Wolfram Language. 2020. "RipleyK." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RipleyK.html.
APA
Wolfram Language. (2020). RipleyK. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RipleyK.html
Wolfram Language. (2020). RipleyK. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RipleyK.html
BibTeX
@misc{reference.wolfram_2025_ripleyk, author="Wolfram Research", title="{RipleyK}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/RipleyK.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_ripleyk, organization={Wolfram Research}, title={RipleyK}, year={2020}, url={https://reference.wolfram.com/language/ref/RipleyK.html}, note=[Accessed: 29-March-2025
]}