SLIK.adapt: Simultaneous global/pilot likelihood bandwidth selection

View source: R/SLIK.adapt.R

SLIK.adaptR Documentation

Simultaneous global/pilot likelihood bandwidth selection

Description

Isotropic global and pilot bandwidth selection for adaptive density/intensity based on likelihood cross-validation.

Usage

SLIK.adapt(
  pp,
  hold = TRUE,
  start = rep(OS(pp), 2),
  hlim = NULL,
  edge = TRUE,
  zero.action = c(-1, 0),
  optim.control = list(),
  parallelise = NULL,
  verbose = TRUE,
  ...
)

Arguments

pp

An object of class ppp giving the observed 2D data to be smoothed.

hold

Logical value indicating whether to hold the global and pilot bandwidths equal throughout the optimisation; defaults to TRUE. See ‘Details’.

start

A positively-valued numeric vector of length 2 giving the starting values to be used for the global/pilot optimisation routine when hold = FALSE. Defaults to the oversmoothing bandwidth (OS) for both values; ignored when hold = TRUE.

hlim

An optional vector of length 2 giving the limits of the optimisation routine with respect to the bandwidth when hold = TRUE. If unspecified, the function attempts to choose this automatically. Ignored when hold = FALSE.

edge

Logical value indicating whether to edge-correct the density estimates used.

zero.action

A numeric vector of length 2, each value being either -1, 0 (default), 1 or 2 controlling how the function should behave in response to numerical errors at very small bandwidths, when such a bandwidth results in one or more zero or negative density values during the leave-one-out computations. See ‘Details’.

optim.control

An optional list to be passed to the control argument of optim for further control over the numeric optimisation when hold = FALSE. See the documentation for optim for further details.

parallelise

Numeric argument to invoke parallel processing in the brute force leave-one-out calculations, giving the number of CPU cores to use. Experimental. Test your system first using parallel::detectCores() to identify the number of cores available to you. If NA (default), no parallelisation performed and a single loop is used.

verbose

Logical value indicating whether to provide function progress commentary.

...

Additional arguments controlling density estimation for the internal calculations. Relevant arguments are resolution, gamma.scale, and trim. If unsupplied these default to 64, "geometric", and 5 respectively; see bivariate.density for a further explanation of these arguments.

Details

This function is a generalisation of LIK.density, and is used in attempts to simultaneously choose an optimal global and pilot bandwidth for adaptive kernel density estimates. Where LIK.density for adaptive estimates assumes the pilot density is held constant (and is not subject to the leave-one-out operations), this function allows the pilot bandwidth to vary alongside the global.

Thus, in contrast to LIK.density the internal leave-one-out operations now also affect the pilot estimation stage. Hence, the set of variable bandwidths changes as each point is left out. In turn, this means the leave-one-out operations must be computed by brute force, and this is computationally expensive.

Identifiability problems can sometimes arise when the global and pilot bandwidths are allowed to ‘float freely’ in the bivariate optimisation routine, which is the default behaviour of the function (with hold = FALSE). This can be curbed by setting hold = TRUE, which forces both the global and pilot to be held at the same value during optimisation. Doing this also has the beneficial side effect of turning the problem into one of univariate optimisation, thereby reducing total computational cost. Current work (Davies & Lawson, 2018) provides some empirical evidence that this strategy performs quite well in practice.

Like LSCV.density and LIK.density, the argument zero.action can be used to control the level of severity in response to small bandwidths that result (due to numerical error) in at least one density value being zero or less. When this argument is passed a vector of length 2, the first entry corresponds to the global bandwidth (and hence refers to checks of the final adaptive density estimate and its leave-one-out values) and the second to the pilot bandwidth (and hence checks the fixed-bandwidth pilot density and its leave-one-out values). Alternatively a single value may be supplied, which will be taken to be the same for both global and pilot. See the help page for LIK.density for an explanation of the four allowable values (-1, 0, 1, 2) for each component of this argument.

Value

A numeric vector of length 2 giving the likelihood-maximised global and pilot bandwidths.

Note

While theoretically valid, this is a largely experimental function. There is presently little in the literature to suggest how well this type of simultaneous global/pilot bandwidth selection might perform in practice. Current research efforts (Davies & Lawson, 2018) seek in part to address these questions.

Author(s)

T. M. Davies

References

Davies, T.M. and Lawson, A.B. (2018), An evaluation of likelihood-based bandwidth selectors for spatial and spatiotemporal kernel estimates, Submitted for publication.

Silverman, B.W. (1986), Density Estimation for Statistics and Data Analysis, Chapman & Hall, New York.

Wand, M.P. and Jones, C.M., 1995. Kernel Smoothing, Chapman & Hall, London.

See Also

Functions for bandwidth selection in package spatstat: bw.diggle; bw.ppl; bw.scott; bw.frac.

Examples





data(pbc)
pbccas <- split(pbc)$case

SLIK.adapt(pbccas)
SLIK.adapt(pbccas,hold=TRUE)

 


sparr documentation built on March 31, 2023, 8:40 p.m.