Uses likelihood cross-validation to select a smoothing bandwidth for the kernel estimation of point process intensity.
bw.ppl(X, ..., srange=NULL, ns=16, sigma=NULL, varcov1=NULL,
weights=NULL, shortcut=FALSE, warn=TRUE)
A numerical value giving the selected bandwidth.
The result also belongs to the class "bw.optim"
which can be plotted.
A point pattern (object of class "ppp"
).
Optional numeric vector of length 2 giving the range of values of bandwidth to be searched.
Optional integer giving the number of values of bandwidth to search.
Optional. Vector of values of the bandwidth to be searched.
Overrides the values of ns
and srange
.
Optional. Variance-covariance matrix matrix of the kernel with bandwidth \(h=1\). See section on Anisotropic Smoothing.
Optional. Numeric vector of weights for the points of X
.
Argument passed to density.ppp
.
Additional arguments passed to
density.ppp
.
Logical value indicating whether to speed up the calculation by omitting the integral term in the cross-validation criterion.
Logical. If TRUE
, issue a warning if the maximum of
the cross-validation criterion occurs at one of the ends of the
search interval.
Anisotropic kernel smoothing is available in density.ppp
using
the argument varcov
to specify the variance-covariance
matrix of the anisotropic kernel. In order to choose the matrix
varcov
, the user can call bw.ppl
using the argument varcov1
to specify a ‘template’
matrix. Scalar multiples of varcov1
will be
considered and the optimal scale factor will be determined.
That is, bw.ppl
will try
smoothing the data using varcov = h^2 * varcov1
for different
values of h
.
The result of bw.ppl
will be the optimal value of h
.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk.
This function selects an appropriate bandwidth sigma
for the kernel estimator of point process intensity
computed by density.ppp
.
The bandwidth \(\sigma\) is chosen to maximise the point process likelihood cross-validation criterion $$ \mbox{LCV}(\sigma) = \sum_i \log\hat\lambda_{-i}(x_i) - \int_W \hat\lambda(u) \, {\rm d}u $$ where the sum is taken over all the data points \(x_i\), where \(\hat\lambda_{-i}(x_i)\) is the leave-one-out kernel-smoothing estimate of the intensity at \(x_i\) with smoothing bandwidth \(\sigma\), and \(\hat\lambda(u)\) is the kernel-smoothing estimate of the intensity at a spatial location \(u\) with smoothing bandwidth \(\sigma\). See Loader(1999, Section 5.3).
The value of \(\mbox{LCV}(\sigma)\) is computed
directly, using density.ppp
,
for ns
different values of \(\sigma\)
between srange[1]
and srange[2]
.
The result is a numerical value giving the selected bandwidth.
The result also belongs to the class "bw.optim"
which can be plotted to show the (rescaled) mean-square error
as a function of sigma
.
If shortcut=TRUE
, the computation is accelerated by
omitting the integral term in the equation above. This is valid
because the integral is approximately constant.
Loader, C. (1999) Local Regression and Likelihood. Springer, New York.
density.ppp
,
bw.diggle
,
bw.scott
,
bw.CvL
,
bw.frac
.
if(interactive()) {
b <- bw.ppl(redwood)
plot(b, main="Likelihood cross validation for redwoods")
plot(density(redwood, b))
}
# \testonly{
b1 <- bw.ppl(redwood, srange=c(0.03, 0.07), ns=2)
b2 <- bw.ppl(redwood, srange=c(0.03, 0.07), ns=2, shortcut=TRUE)
# }
Run the code above in your browser using DataLab