bw.relrisk.lpp | R Documentation |
Uses cross-validation to select a smoothing bandwidth for the estimation of relative risk on a linear network.
## S3 method for class 'lpp'
bw.relrisk(X, ...,
method = c("likelihood", "leastsquares", "KelsallDiggle", "McSwiggan"),
distance=c("path", "euclidean"),
hmin = NULL, hmax = NULL, nh = NULL,
fast = TRUE, fastmethod = "onestep",
floored = TRUE, reference = c("thumb", "uniform", "sigma"),
allow.infinite = TRUE, epsilon = 1e-20, fudge = 0,
verbose = FALSE, warn = TRUE)
X |
A multitype point pattern on a linear network (object of class
|
... |
Arguments passed to |
method |
Character string (partially matched) determining the cross-validation method. See Details. |
distance |
Character string (partially matched)
specifying the type of smoothing kernel.
See |
hmin , hmax |
Optional. Numeric values.
Range of trial values of smoothing bandwith |
nh |
Number of trial values of smoothing bandwidth |
fast |
Logical value specifying whether the leave-one-out density estimates
should be computed using a fast approximation ( |
fastmethod , floored |
Developer use only. |
reference |
Character string (partially matched) specifying the
bandwidth for calculating the
reference intensities used in the McSwiggan method
(modified Kelsall-Diggle method).
|
allow.infinite |
Logical value indicating whether an infinite bandwidth (corresponding to a constant relative risk) should be permitted as a possible choice of bandwidth. |
epsilon |
A small constant value added to the reference density in some of the cross-validation calculations, to improve performance. |
fudge |
Fudge factor to prevent very small density estimates in the
leave-one-out calculation. If |
verbose |
Logical value indicating whether to print progress reports, |
warn |
Logical. If |
This function is a method for the generic bw.relrisk
.
It computes an optimal value of smoothing bandwidth
for the nonparametric estimation of relative risk on a linear network
using relrisk.lpp
.
The optimal value is found by minimising a cross-validation criterion.
The cross-validation criterion is selected by the argument method
:
method="likelihood" | (negative) likelihood cross-validation |
method="leastsquares" | least squares cross-validation |
method="KelsallDiggle" | Kelsall and Diggle (1995) density ratio cross-validation |
method="McSwiggan" | McSwiggan et al (2019) modified density ratio cross-validation |
See McSwiggan et al (2019) for details.
The result is a numerical value giving the selected bandwidth sigma
.
The result also belongs to the class "bw.optim"
allowing it to be printed and plotted. The plot shows the cross-validation
criterion as a function of bandwidth.
The ‘optimal’ bandwidth is the value of bandwidth
which minimises the cross-validation criterion.
The range of values for the smoothing bandwidth sigma
is set by the arguments hmin, hmax
. There is a sensible default,
based on the linear network version of Scott's rule
bw.scott.iso
.
If the optimal bandwidth is achieved at an endpoint of the
interval [hmin, hmax]
, the algorithm will issue a warning
(unless warn=FALSE
). If this occurs, then it is probably advisable
to expand the interval by changing the arguments hmin, hmax
.
The cross-validation procedure is based on kernel estimates
of intensity, which are computed by density.lpp
.
Any arguments ...
are passed to density.lpp
to control the kernel estimation procedure. This includes the
argument distance
which specifies the type of kernel.
The default is distance="path"
;
the fastest option is distance="euclidean"
.
A single numerical value giving the selected bandwidth.
The result also belongs to the class "bw.optim"
(see bw.optim.object
)
which can be plotted to show the bandwidth selection criterion
as a function of sigma
.
Greg McSwiggan and \adrian.
Kelsall, J.E. and Diggle, P.J. (1995) Kernel estimation of relative risk. Bernoulli 1, 3–16.
McSwiggan, G., Baddeley, A. and Nair, G. (2019) Estimation of relative risk for events on a linear network. Statistics and Computing 30 (2) 469–484.
relrisk.lpp
, bw.relrisk
,
bw.optim.object
set.seed(2020)
X <- superimpose(A=runiflpp(20, simplenet),
B=runifpointOnLines(20, as.psp(simplenet)[1]))
plot(bw.relrisk(X, hmin=0.13, hmax=0.22, method="McSwiggan"))
plot(bw.relrisk(X, hmin=0.1, hmax=0.2, nh=8, distance="euclidean"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.