bw.abram  R Documentation 
Computes adaptive smoothing bandwidths according to the inversesquareroot rule of Abramson (1982).
bw.abram(X, h0, ..., at=c("points", "pixels"), hp = h0, pilot = NULL, trim=5, smoother=density.ppp)
X 
A point pattern (object of class 
h0 
A scalar value giving the global smoothing bandwidth
in the same units as the coordinates of 
... 
Additional arguments passed to

at 
Character string (partially matched) specifying whether
to compute bandwidth values at the points of 
hp 
Optional. A scalar pilot bandwidth, used for estimation
of the pilot density if required. Ignored if 
pilot 
Optional. Specification of a pilot density
(possibly unnormalised).
If 
trim 
A trimming value required to curb excessively large bandwidths. See Details. The default is sensible in most cases. 
smoother 
Smoother for the pilot.
A function or character string, specifying the function
to be used to compute the pilot estimate when

This function computes adaptive smoothing bandwidths using the methods of Abramson (1982) and Hall and Marron (1988).
If at="points"
(the default) a smoothing bandwidth is
computed for each point in the pattern X
. Alternatively if
at="pixels"
a smoothing bandwidth is computed for
each spatial location in a pixel grid.
Under the AbramsonHallMarron rule, the bandwidth at location u is
h(u) = h0 * min(\tilde{f}(u)^{1/2}/γ, trim)
where \tilde{f}(u) is a pilot estimate of the spatially varying
probability density. The variable bandwidths are rescaled by γ, the
geometric mean of the \tilde{f}(u)^{1/2} terms evaluated at the
data; this allows the global bandwidth h0
to be considered on
the same scale as a corresponding fixed bandwidth. The trimming value
trim
has the same interpretation as the required ‘clipping’ of
the pilot density at some small nominal value (see Hall and Marron,
1988), to necessarily prevent extreme bandwidths (which
can occur at very isolated observations).
The pilot density or intensity is determined as follows:
If pilot
is a pixel image, this is taken as the
pilot density or intensity.
If pilot
is NULL
, then the pilot intensity is
computed as a fixedbandwidth kernel
intensity estimate using density.ppp
applied to
the data pattern X
using
the pilot bandwidth hp
.
If pilot
is a different point pattern on the same spatial
domain as X
, then the pilot intensity is
computed as a fixedbandwidth kernel
intensity estimate using density.ppp
applied to
pilot
using the pilot bandwidth hp
.
In each case the pilot density or intensity is renormalised to become a probability density, and then the Abramson rule is applied.
Instead of calculating the pilot as a fixedbandwidth density
estimate, the user can specify another density estimation procedure
using the argument smoother
. This should be either a function
or the character string name of a function. It will replace
density.ppp
as the function used to calculate the
pilot estimate. The pilot estimate will be computed as
smoother(X, sigma=hp, ...)
if pilot
is NULL
,
or smoother(pilot, sigma=hp, ...)
if pilot
is a point
pattern. If smoother
does not recognise the argument name
sigma
for the smoothing bandwidth, then hp
is effectively
ignored, as shown in the Examples.
Either a numeric vector of length npoints(X)
giving the Abramson bandwidth for each point
(when at = "points"
, the default),
or the entire pixel im
age
of the Abramson bandwidths over the relevant spatial domain
(when at = "pixels"
).
Tilman M. Davies. Adapted by \adrian.
Abramson, I. (1982)
On bandwidth variation in kernel estimates — a square root law.
Annals of Statistics, 10(4), 12171223.
Davies, T.M. and Baddeley, A. (2018)
Fast computation of spatially adaptive kernel estimates.
Statistics and Computing, 28(4), 937956.
Davies, T.M., Marshall, J.C., and Hazelton, M.L. (2018)
Tutorial on kernel estimation of continuous spatial
and spatiotemporal relative risk.
Statistics in Medicine, 37(7), 11911221.
Hall, P. and Marron, J.S. (1988)
Variable window width kernel density estimates of probability
densities.
Probability Theory and Related Fields, 80, 3749.
Silverman, B.W. (1986) Density Estimation for Statistics and Data Analysis. Chapman and Hall, New York.
# 'ch' just 58 laryngeal cancer cases ch < split(chorley)[[1]] h < bw.abram(ch,h0=1,hp=0.7) length(h) summary(h) if(interactive()) hist(h) # calculate pilot based on all 1036 observations h.pool < bw.abram(ch,h0=1,hp=0.7,pilot=chorley) length(h.pool) summary(h.pool) if(interactive()) hist(h.pool) # get full image used for 'h' above him < bw.abram(ch,h0=1,hp=0.7,at="pixels") plot(him);points(ch,col="grey") # use VoronoiDirichlet pilot ('hp' is ignored) hvo < bw.abram(ch, h0=1, smoother=densityVoronoi)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.