SpatialJ
✖
SpatialJ
Details and Options




- The function
is the ratio of the probability of finding no point within distance
of a typical point to the probability of finding no point within distance
of any location. It is given as
, where
is NearestNeighborG and
is EmptySpaceF.
- SpatialJ measures spatial homogeneity of a point collection within distance
. In comparing with a Poisson point process:
-
more dispersed than Poisson like Poisson, i.e. complete spatial randomness more clustered than Poisson - The radius r can be a single value or a list of values. With no radius r specified, SpatialJ 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 parameter free and SpatialObservationRegionQ.
- The binned data bdata is from SpatialBinnedPointData and is treated as an InhomogeneousPoissonPointProcess with a piecewise constant intensify function.
- For pdata,
is computed from the points pi by combining the estimates of
and
. The estimation assumes the point pattern is stationary in space.
- 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 "Hanisch" drops points for which the distance to the nearest neighbor is greater than the distance to boundary "KaplanMeier" SurvivalDistribution method: the point distance to its nearest neighbor is censored by its distance to the region boundary "NelsonAalen" SurvivalDistribution method: the point distance to its nearest neighbor is censored by its distance to the region boundary - The setting Method->{"Discretization"->opts} allows for adjusting the discretization method in the estimation. Here opts can be any valid options for DiscretizeRegion.


Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Estimate the function at a given distance:

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

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

Estimate the function within a range of distances:

https://wolfram.com/xid/0b8b6f7g1d-c9nijx


https://wolfram.com/xid/0b8b6f7g1d-bmyu9a

https://wolfram.com/xid/0b8b6f7g1d-ee0oxv
Visualize the result with ListPlot:

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

Empty space function of a cluster point process:

https://wolfram.com/xid/0b8b6f7g1d-suhjpp

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

Scope (7)Survey of the scope of standard use cases
Point Data (4)
Estimate the function for some data at distance 0.1:

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

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

Obtain empirical estimates of the function for a list of given distances:

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

Create a PointStatisticFunction for future use:

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

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

Compute a value at a given radius:

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

Estimate the function without explicitly providing the observation region:

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

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

Observation region generated by Ripley–Rasson estimator:

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

Estimated function at distance 0.05:

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

Use SpatialJ with GeoPosition:

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


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

Plot the point statistics function:

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

Point Processes (3)
The function function for PoissonPointProcess is always identity:

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

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

This is so because EmptySpaceF and NearestNeighborG of a PoissonPointProcess are identical:

https://wolfram.com/xid/0b8b6f7g1d-peicch


https://wolfram.com/xid/0b8b6f7g1d-s1mw7o


https://wolfram.com/xid/0b8b6f7g1d-iuhnsy

The function for a cluster process ThomasPointProcess with specified dimension:

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

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


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

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

The function for a cluster process MaternPointProcess with specified dimension:

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

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


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

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

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

https://wolfram.com/xid/0b8b6f7g1d-1aqzq

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

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

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

The "Hanisch" method weights each point in the observation region to make the estimated values unbiased:

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

The "KaplanMeier" and "NelsonAalen" methods are estimators used in SurvivalDistribution. The distance of each point to its nearest neighbor point is censored by the distance of each point to the boundary of the observation region:

https://wolfram.com/xid/0b8b6f7g1d-g51708


https://wolfram.com/xid/0b8b6f7g1d-e9hv8s

Method (1)
Discretization setting can be provided under Method as suboptions:

https://wolfram.com/xid/0b8b6f7g1d-uj3zyb
Estimate the function at the same radius with different values of MaxCellMeasure:

https://wolfram.com/xid/0b8b6f7g1d-cpbs9d

Use different discretization methods to estimate the function at the same radius:

https://wolfram.com/xid/0b8b6f7g1d-kd4lvk

Applications (2)Sample problems that can be solved with this function
Compare empirical estimates and the theoretical function under complete spatial randomness:

https://wolfram.com/xid/0b8b6f7g1d-kinnz
Estimate the values of the function with given data:

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

https://wolfram.com/xid/0b8b6f7g1d-c9d4xs

Compare the function estimate of Matérn point processes with different cluster radius:

https://wolfram.com/xid/0b8b6f7g1d-887yj9
Estimate the values of the function with given data:

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

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

Properties & Relations (3)Properties of the function, and connections to other functions
SpatialJ measures clustering of a point collection. indicates the points are clustered within distance
, while
indicates the points are dispersed within distance
. Generate samples from lattice points, a Poisson point process and a Thomas point process:

https://wolfram.com/xid/0b8b6f7g1d-cm1a2f

https://wolfram.com/xid/0b8b6f7g1d-fnjfs5

Estimate from each sample and compare the results:

https://wolfram.com/xid/0b8b6f7g1d-tg3u8

https://wolfram.com/xid/0b8b6f7g1d-fmmdvv

Visualize how NearestNeighborG impacts SpatialJ:

https://wolfram.com/xid/0b8b6f7g1d-eqvqul

NearestNeighborG estimates the probability of finding another point within distance r from a point in the point collection:

https://wolfram.com/xid/0b8b6f7g1d-o9rtf6

https://wolfram.com/xid/0b8b6f7g1d-pj4yjt

Visualize how EmptySpaceF impacts SpatialJ:

https://wolfram.com/xid/0b8b6f7g1d-5beqeu

EmptySpaceF estimates the probability of finding another point within distance r from a reference point:

https://wolfram.com/xid/0b8b6f7g1d-c4kn8c

https://wolfram.com/xid/0b8b6f7g1d-l9fyqo

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