Learn R Programming

markstat (version 0.1.5)

mcorrinhom.ppp: Mark correlation functions for inhomogeneous point patterns on Euclidean spaces.

Description

Mark correlation functions for inhomogeneous point patterns on Euclidean spaces.

Usage

# S3 method for ppp
mcorrinhom(X,
ftype = c("variogram", "stoyan", "rcorr", "shimatani",
 "beisbart", "isham", "stoyancov", "schlather"),
r = NULL,
lambda = NULL,
method_lambda = c("kernel", "Voronoi"),
bw = bw.scott,
f = NULL,
method = c("density", "loess"),
correction = c("Ripley", "translate", "none"),
normalise = TRUE,
tol = 0.01,
...)

Value

a data.frame which gives the estimated mark correlation function and the distance vector \(r\) at which the mark correlation function is estimated. If the point patten \(X\) has multiple real-valued marks, the estimated mark correlation function will be given for each mark. Name of columns will be the name of marks.

Arguments

X

An object of class ppp.

ftype

Type of the test function \(t_f\). Currently any selection of "variogram", "stoyan", "rcorr", "shimatani", "beisbart", "isham", "stoyancov", "schlather".

r

Optional. The values of the argument r at which the mark correlation function should be evaluated.

lambda

Estimated intensity at data points. If not given, it will be estimated internally. See details.

method_lambda

The method to be used for estimating intensity at data points, if lambda = NULL.

bw

Bandwidth method to be used for estimating intensity at data points if lambda = NULL and method_lambda = "kernel".

f

Optional. Test function \(t_f\) used in the definition of the mark correlation function. If ftype is given, \(t_f\) should be NULL.

method

Type of smoothing, either density or loess.

correction

Type of edge correction to be applied, either of "Ripley", "translate", "none".

normalise

If normalise=FALSE, only the numerator of the expression for the mark correlation function will be computed.

tol

Tolerance used in the calculation of the conditional mean of marks. This is used only if ftype is schlather.

...

Arguments passed to unnormdensity or loess.

Author

Mehdi Moradi m2.moradi@yahoo.com and Matthias Eckardt

Details

For an inhomogeneous point process \(X\) in \(R^2\), the \(t_f\)-correlation function \(\kappa_{t_f}^{inhom}(r)\) is given as $$ \kappa_{t_f}^{inhom}(r) = \frac{ \mathbb{E}_w \left[ t_f \left( m_x, m_y \right) \mid x, y \in X \right] }{ c_{t_f} }, \quad d(x,y)=r, $$ where \(m_x, m_y\) are the marks of \(x, y \in X\), \(\mathbb{E}_w\) is a conditional expectation with respect to a weighted Palm distribution, \(c_{t_f}\) is a normalising factor, and \(d(x,y)=r\) is the Euclidean distance. Therefore, each mark correlation function is defined by a specific test function \(t_f(m_x, m_y)\) and its associated normalising factor \(c_{t_f}\). Let \(\mu_m\) and \(\sigma^2_m\) be the mean and variance of marks, then, the list below gives different test functions \(t_f\) and their normalised factors \(c_{t_f}\), following distinct available ftype.

variogram:

\(t_f(m_x, m_y) = \frac{1}{2}(m_x - m_y)^2\), \(c_{t_f} = \sigma^2_m\).

stoyan:

\(t_f(m_x, m_y) = m_x m_y\), \(c_{t_f} = \mu^2_m\).

rcorr:

\(t_f(m_x, m_y) = m_x\), \(c_{t_f} = \mu_m\).

shimatani:

\(t_f(m_x, m_y) = (m_x - \mu_m)(m_y - \mu_m)\), \(c_{t_f} = \sigma^2_m\).

beisbart:

\(t_f(m_x, m_y) = m_x + m_y\), \(c_{t_f} = 2 \mu_m\).

isham:

\(t_f(m_x, m_y) = m_x m_y - \mu^2_m\), \(c_{t_f} = \sigma^2_m\).

stoyancov:

\(t_f(m_x, m_y) = m_x m_y - \mu^2_m\), \(c_{t_f} = 1\).

schlather:

\(t_f(m_x, m_y) = (m_x - \mu_m(r))(m_y - \mu_m(r))\), \(c_{t_f} = \sigma^2_m\).

For ftype="schlather", \(\mu_m(r)\) denotes the mean of the marks of all pairs of points whose pairwise distance lies within a tolerance tol of \(r\). We refer to Eckardt and Moradi (2024) for details of these mark correlation functions.

Regarding the smoothing functions, if method="density", the functions unnormdensity will be called, and if method="loess", the function loess will be called.

If your ftype is not one of the defaults, then you need to give your test function \(t_f(m_1, m_2)\) using the argument f. In this case, normalise should be set as FALSE, as only the unnormalised version will be calculated. Depending on the form of the test function \(t_f(m_1, m_2)\), one can manually compute the normalisation factor.

If lambda = NULL, the function internally estimates the intensity function using the given method via method_lambda. If method_lambda = "kernel", the function calls density.ppp, with the bandwidth chosen by the given method bw, and argument diggle=TRUE. If method_lambda = "Voronoi", then the functions calls densityVoronoi.ppp with arguments f=0.2, nrep = 400 which are recommended by Moradi et al. (2019).

Regarding the smoothing functions, if method="density", the functions unnormdensity will be called, and if method="loess", the function loess will be called.

Type of edge correction is chosen among "Ripley", "translate", "none". See details in edge.Trans and edge.Ripley.

If the point patten \(X\) has multiple real-valued marks, the function estimates the mark correlation function for each mark individually. In such case, marks are given as a data.frame whose columns represents different marks. The functions checks which columns are numeric, and for those the mark correlation function will be computed.

References

Moradi, M., Cronie, O., Rubak, E., Lachieze-Rey, R., Mateu, J., & Baddeley, A. (2019). Resample-smoothing of Voronoi intensity estimators. Statistics and computing, 29(5), 995-1010.

Moradi, M., & Eckardt, M. (2025). Inhomogeneous mark correlation functions for general marked point processes. arXiv e-prints, arXiv-2505.

See Also

mcorr.ppp, mcorrinhom.lpp.

Examples

Run this code
 library(spatstat.geom)
 library(spatstat.random)
 library(spatstat.explore)
 X <- rpoispp(function(x,y) {100 * exp(-3*x)}, 100)
 marks(X) <- runif(npoints(X), 1, 10)
 mcorrinhom.ppp(X, ftype = "stoyan",
                method = "density", correction = "translate",
                method_lambda = "kernel", bw = bw.scott)

Run the code above in your browser using DataLab