bw.abram.default {spatstat.univar} | R Documentation |
Abramson's Adaptive Bandwidths For Numeric Data
Description
Computes adaptive smoothing bandwidths for numeric data, according to the inverse-square-root rule of Abramson (1982).
Usage
## Default S3 method:
bw.abram(X, h0, ...,
at = c("data", "grid"),
pilot = NULL, hp = h0, trim = 5, smoother = density.default)
Arguments
X |
Data for which bandwidths should be calculated. A numeric vector. |
h0 |
A scalar value giving the global smoothing bandwidth
in the same units as |
... |
Arguments passed to |
at |
Character string (partially matched) specifying whether to
compute bandwidth values only at the data points of |
pilot |
Optional. Specification of a pilot density (possibly unnormalised).
Either a numeric vector giving the pilot density for each
data point of |
hp |
Optional. A scalar pilot bandwidth, used for estimation
of the pilot density, 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
|
Details
This function computes adaptive smoothing bandwidths using the methods of Abramson (1982) and Hall and Marron (1988).
The function bw.abram
is generic. The function
bw.abram.default
documented here is the default method
which is designed for numeric data.
If at="data"
(the default) a smoothing bandwidth is
computed for each data point in X
. Alternatively if
at="grid"
a smoothing bandwidth is computed for
a grid of x
values.
Under the Abramson-Hall-Marron rule, the bandwidth at location u
is
h(u) = \mbox{\texttt{h0}}
* \mbox{min}[ \frac{\tilde{f}(u)^{-1/2}}{\gamma}, \mbox{\texttt{trim}} ]
where \tilde{f}(u)
is a pilot estimate of the
probability density. The variable bandwidths are rescaled by \gamma
, 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 afunction
in the R language, this is taken as the pilot density.If
pilot
is a probability density estimate (object of class"density"
produced bydensity.default
) then this is taken as the pilot density.If
pilot
isNULL
, then the pilot intensity is computed as a fixed-bandwidth kernel intensity estimate usingdensity.default
applied to the dataX
using the pilot bandwidthhp
.
In each case the pilot density is renormalised to become a probability density, and then the Abramson rule is applied.
Instead of calculating the pilot as a fixed-bandwidth 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.default
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.
Value
Either a numeric vector of the same length as X
giving the Abramson bandwidth for each point
(when at = "data"
, the default),
or a function
giving the Abramson bandwidths
as a function of location.
Author(s)
Tilman Davies Tilman.Davies@otago.ac.nz. Adapted by Adrian Baddeley Adrian.Baddeley@curtin.edu.au.
References
Abramson, I. (1982) On bandwidth variation in kernel estimates — a square root law. Annals of Statistics, 10(4), 1217-1223.
Hall, P. and Marron, J.S. (1988) Variable window width kernel density estimates of probability densities. Probability Theory and Related Fields, 80, 37-49.
Silverman, B.W. (1986) Density Estimation for Statistics and Data Analysis. Chapman and Hall, New York.
See Also
Examples
xx <- rexp(20)
bw.abram(xx)