Isotropic global and pilot bandwidth selection for adaptive density/intensity based on likelihood cross-validation.
An object of class ppp
giving the observed
2D data to be smoothed.
Logical value indicating whether to hold the global and pilot bandwidths equal throughout the
optimisation; defaults to TRUE
. See `Details'.
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
.
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
.
Logical value indicating whether to edge-correct the density estimates used.
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'.
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.
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.
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.
A numeric vector of length 2 giving the likelihood-maximised global and pilot bandwidths.
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.
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.
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.
# \donttest{
data(pbc)
pbccas <- split(pbc)$case
SLIK.adapt(pbccas)
#> h0: 5.897416; hp: 5.897416
#> h0: 9.480417; hp: 9.480417
#> h0: 3.683; hp: 3.683
#> h0: 2.314416; hp: 2.314416
#> h0: 1.468584; hp: 1.468584
#> h0: 2.837169; hp: 2.837169
#> h0: 1.991337; hp: 1.991337
#> h0: 1.791663; hp: 1.791663
#> h0: 2.114742; hp: 2.114742
#> h0: 1.915069; hp: 1.915069
#> h0: 2.038474; hp: 2.038474
#> h0: 1.962205; hp: 1.962205
#> h0: 1.944201; hp: 1.944201
#> h0: 1.933073; hp: 1.933073
#> h0: 1.926196; hp: 1.926196
#> h0: 1.937323; hp: 1.937323
#> h0: 1.930446; hp: 1.930446
#> h0: 1.928823; hp: 1.928823
#> h0: 1.93145; hp: 1.93145
#> h0: 1.929826; hp: 1.929826
#> h0: 1.929443; hp: 1.929443
#> h0: 1.929206; hp: 1.929206
#> h0: 1.929589; hp: 1.929589
#> h0: 1.929352; hp: 1.929352
#> h0: 1.929296; hp: 1.929296
#> h0: 1.929256; hp: 1.929256
#> h0: 1.929256; hp: 1.929256
#> h0 hp
#> 1.929256 1.929256
SLIK.adapt(pbccas,hold=TRUE)
#> h0: 5.897416; hp: 5.897416
#> h0: 9.480417; hp: 9.480417
#> h0: 3.683; hp: 3.683
#> h0: 2.314416; hp: 2.314416
#> h0: 1.468584; hp: 1.468584
#> h0: 2.837169; hp: 2.837169
#> h0: 1.991337; hp: 1.991337
#> h0: 1.791663; hp: 1.791663
#> h0: 2.114742; hp: 2.114742
#> h0: 1.915069; hp: 1.915069
#> h0: 2.038474; hp: 2.038474
#> h0: 1.962205; hp: 1.962205
#> h0: 1.944201; hp: 1.944201
#> h0: 1.933073; hp: 1.933073
#> h0: 1.926196; hp: 1.926196
#> h0: 1.937323; hp: 1.937323
#> h0: 1.930446; hp: 1.930446
#> h0: 1.928823; hp: 1.928823
#> h0: 1.93145; hp: 1.93145
#> h0: 1.929826; hp: 1.929826
#> h0: 1.929443; hp: 1.929443
#> h0: 1.929206; hp: 1.929206
#> h0: 1.929589; hp: 1.929589
#> h0: 1.929352; hp: 1.929352
#> h0: 1.929296; hp: 1.929296
#> h0: 1.929256; hp: 1.929256
#> h0: 1.929256; hp: 1.929256
#> h0 hp
#> 1.929256 1.929256
# }