Learn R Programming

spatstat.explore (version 3.8-0)

bw.bdh: Adjust Bandwidth Selection Rule to Account for Inhomogeneity

Description

Calculate a bandwidth for kernel estimation of the inhomogeneous pair correlation function. Given a bandwidth selection rule or bandwidth value which would be appropriate for a homogeneous point pattern, this function adjusts the bandwidth to account for inhomogeneity.

Usage

bw.bdh(X, lambda=NULL, ..., base=bw.stoyan, k=2)

Arguments

Value

A finite positive numerical value giving the selected bandwidth (the standard deviation of the smoothing kernel). The result has an attribute "adjust" giving the adjustment factor \(a\).

Details

This function calculates a bandwidth value for kernel estimation of the inhomogeneous pair correlation function using pcfinhom.

It takes a bandwidth value or bandwidth selection rule that would be appropriate if the point process were homogeneous, adjusts the bandwidth to account for inhomogeneity, and returns the adjusted bandwidth value.

The adjusted (inhomogeneous) bandwidth is the original (homogeneous) bandwidth multiplied by the Baddeley, Davies and Hazelton (2025) variance controlling adjustment factor.

First a numerical bandwidth value, appropriate for a homogeneous process, is calculated. The default is to apply the extrapolated Stoyan rule-of-thumb bw.stoyan to the point pattern X. If base is specified, it may be either a numeric value for the bandwidth, or another function that will be applied to X to calculate a bandwidth value.

Next the intensity value at each point of X is evaluated. The argument lambda may be:

  • a numeric vector giving the intensity values at the points of X;

  • a pixel image (object of class "im") giving the intensity values at all locations;

  • a fitted point process model (object of class "ppm", "kppm" or "dppm"). The intensity of the fitted model will be evaluated at each point of X. By default, the fitted model is updated by re-fitting it to X before the intensity is evaluated. Updating can be disabled by setting update=FALSE.

  • a function(x,y) which can be evaluated to give the intensity value at any location;

  • missing or NULL. In this case, the intensity will be estimated from X using density.ppp. Arguments ... controlling the kernel estimation include sigma, varcov and kernel.

Finally the bandwidth is adjusted by multiplying it by the Baddeley, Davies and Hazelton (2025) variance-controlling factor $$ a = (n^{-1} \sum_i \lambda_i ) \, (n^{-1} \sum_i \lambda_i^{-k} )^{1/k} $$ where \(\lambda_i\) is the value of lambda for the \(i\)th data point X[i].

When k=2 (the default), the adjustment factor is $$ a = (n^{-1} \sum_i \lambda_i ) \, \sqrt{n^{-1} \sum_i \lambda_i^{-2}} ) $$

References

Baddeley, A., Davies, T.M. and Hazelton, M.L. (2025) An improved estimator of the pair correlation function of a spatial point process. Biometrika 111, 2, article asaf021.

See Also

bw.stoyan, bw.pcf, pcfinhom

Examples

Run this code
  if(require(spatstat.model)) {
    fit <- ppm(japanesepines ~ x)
    (b <- bw.bdh(japanesepines, fit))
    attr(b, "adjust")
  }

Run the code above in your browser using DataLab