Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bw.relrisklpp

Cross Validated Bandwidth Selection for Relative Risk Estimation on a Network


Description

Uses cross-validation to select a smoothing bandwidth for the estimation of relative risk on a linear network.

Usage

bw.relrisklpp(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)

Arguments

X

A multitype point pattern on a linear network (object of class "lpp" which has factor-valued marks).

...

Arguments passed to density.lpp to control the resolution of the algorithm.

method

Character string (partially matched) determining the cross-validation method. See Details.

distance

Character string (partially matched) specifying the type of smoothing kernel. See density.lpp.

hmin,hmax

Optional. Numeric values. Range of trial values of smoothing bandwith sigma to consider. There is a sensible default.

nh

Number of trial values of smoothing bandwidth sigma to consider.

fast

Logical value specifying whether the leave-one-out density estimates should be computed using a fast approximation (fast=TRUE, the default) or exactly (fast=FALSE).

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). reference="sigma" means the maximum bandwidth considered, which is given by the argument sigma. reference="thumb" means the bandwidths selected by Scott's rule of thumb bw.scott.iso. reference="uniform" means infinite bandwidth corresponding to uniform intensity.

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 fudge > 0, then the lowest permitted value for a leave-one-out estimate of intensity is fudge/L, where L is the total length of the network.

verbose

Logical value indicating whether to print progress reports,

warn

Logical. If TRUE, issue a warning if the minimum of the cross-validation criterion occurs at one of the ends of the search interval.

Details

This function 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 optimising a cross-validation criterion.

The cross-validation criterion is selected by the argument method:

method="likelihood" 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 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".

Value

A numerical value giving the selected bandwidth. The result also belongs to the class "bw.optim" which can be plotted.

Author(s)

Greg McSwiggan and Adrian Baddeley Adrian.Baddeley@curtin.edu.au.

References

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.

See Also

Examples

set.seed(2020)
   X <- superimpose(A=runiflpp(20, simplenet),
                    B=runifpointOnLines(20, as.psp(simplenet)[1]))
   plot(bw.relrisklpp(X, hmin=0.1, hmax=0.3, method="McSwiggan"))
   plot(bw.relrisklpp(X, hmin=0.1, hmax=0.3, distance="euclidean"))

spatstat.linnet

Linear Networks Functionality of the 'spatstat' Family

v2.1-1
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Ottmar Cronie [ctb], Tilman Davies [ctb], Greg McSwiggan [ctb], Suman Rakshit [ctb]
Initial release
2021-03-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.