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.
bw.bdh(X, lambda=NULL, ..., base=bw.stoyan, k=2)
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\).
A point pattern (object of class "ppp"
).
Optional.
Values of the estimated intensity function of X
.
Either a vector giving the intensity values
at the points of the pattern 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"
)
or a function(x,y)
which
can be evaluated to give the intensity value at any location.
If lambda
is missing or NULL
, the intensity will
be estimated from X
using
density.ppp
.
Arguments passed to
density.ppp
to control the
estimation of intensity (if lambda=NULL
),
or arguments passed to base
if it is a function.
Bandwidth selection rule, or bandwidth value, that will be
adjusted. Either a single numeric value, or a function that
will be applied to the pattern X
to obtain a bandwidth value,
or a character string giving the name of such a function.
Integer exponent for calculating the adjustment factor.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Tilman Davies Tilman.Davies@otago.ac.nz and Martin Hazelton Martin.Hazelton@otago.ac.nz.
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}} )
$$
Baddeley, A., Davies, T.M. and Hazelton, M.L. (2025) An improved estimator of the pair correlation function of a spatial point process. Biometrika, to appear.
bw.stoyan
,
bw.pcf
,
pcfinhom
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