Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bw.pcf

Cross Validated Bandwidth Selection for Pair Correlation Function


Description

Uses composite likelihood or generalized least squares cross-validation to select a smoothing bandwidth for the kernel estimation of pair correlation function.

Usage

bw.pcf(X, rmax=NULL, lambda=NULL, divisor="r", 
         kernel="epanechnikov", nr=10000, bias.correct=TRUE, 
         cv.method=c("compLik", "leastSQ"), simple=TRUE, srange=NULL,
	 ..., verbose=FALSE, warn=TRUE)

Arguments

X

A point pattern (object of class "ppp").

rmax

Numeric. Maximum value of the spatial lag distance r for which g(r) should be evaluated.

lambda

Optional. Values of the estimated intensity function. A vector giving the intensity values at the points of the pattern X.

divisor

Choice of divisor in the estimation formula: either "r" (the default) or "d". See pcf.ppp.

kernel

Choice of smoothing kernel, passed to density; see pcf and pcfinhom.

nr

Integer. Number of subintervals for discretization of [0, rmax] to use in computing numerical integrals.

bias.correct

Logical. Whether to use bias corrected version of the kernel estimate. See Details.

cv.method

Choice of cross validation method: either "compLik" or "leastSQ" (partially matched).

simple

Logical. Whether to use simple removal of spatial lag distances. See Details.

srange

Optional. Numeric vector of length 2 giving the range of bandwidth values that should be searched to find the optimum bandwidth.

...

Other arguments, passed to pcf or pcfinhom.

verbose

Logical value indicating whether to print progress reports during the optimization procedure.

warn

Logical. If TRUE, issue a warning if the optimum value of the cross-validation criterion occurs at one of the ends of the search interval.

Details

This function selects an appropriate bandwidth bw for the kernel estimator of the pair correlation function of a point process intensity computed by pcf.ppp (homogeneous case) or pcfinhom (inhomogeneous case).

With cv.method="leastSQ", the bandwidth h is chosen to minimise an unbiased estimate of the integrated mean-square error criterion M(h) defined in equation (4) in Guan (2007a). The code implements the fast algorithm of Jalilian and Waagepetersen (2018).

With cv.method="compLik", the bandwidth h is chosen to maximise a likelihood cross-validation criterion CV(h) defined in equation (6) of Guan (2007b).

M(b) = \int_{0}^{rmax} \hat{g}^2(r;b) r dr - ∑_{u,v}

The result is a numerical value giving the selected bandwidth.

Value

A numerical value giving the selected bandwidth. The result also belongs to the class "bw.optim" which can be plotted.

Definition of bandwidth

The bandwidth bw returned by bw.pcf is the standard deviation of the smoothing kernel, following the standard convention in R. As mentioned in the documentation for density.default and pcf.ppp, this differs from other definitions of bandwidth that can be found in the literature. The scale parameter h, which is called the bandwidth in some literature, is defined differently. For example for the Epanechnikov kernel, h is the half-width of the kernel, and bw=h/sqrt(5).

Author(s)

Rasmus Waagepetersen and Abdollah Jalilian. Adapted for spatstat by Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

References

Guan, Y. (2007a). A composite likelihood cross-validation approach in selecting bandwidth for the estimation of the pair correlation function. Scandinavian Journal of Statistics, 34(2), 336–346.

Guan, Y. (2007b). A least-squares cross-validation bandwidth selection approach in pair correlation function estimations. Statistics & Probability Letters, 77(18), 1722–1729.

Jalilian, A. and Waagepetersen, R. (2018) Fast bandwidth selection for estimation of the pair correlation function. Journal of Statistical Computation and Simulation, 88(10), 2001–2011. https://www.tandfonline.com/doi/full/10.1080/00949655.2018.1428606

See Also

Examples

b <- bw.pcf(redwood)
  plot(pcf(redwood, bw=b))

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.