Bootstrap bandwidths for a spatiotemporal kernel density estimate
Bootstrap bandwidths for a spatiotemporal kernel density estimate
Bandwidth selection for standalone spatiotemporal density/intensity based on bootstrap estimation of the MISE, providing an isotropic scalar spatial bandwidth and a scalar temporal bandwidth.
BOOT.spattemp(pp, tt =NULL, tlim =NULL, eta =NULL, nu =NULL, sedge = c("uniform","none"), tedge = sedge, ref.density =NULL, sres =64, tres = sres, start =NULL, verbose =TRUE)
Arguments
pp: An object of class ppp giving the spatial coordinates of the observations to be smoothed. Possibly marked with the time of each event; see argument tt.
tt: A numeric vector of equal length to the number of points in pp, giving the time corresponding to each spatial observation. If unsupplied, the function attempts to use the values in the marks attribute of the ppp.object in pp.
tlim: A numeric vector of length 2 giving the limits of the temporal domain over which to smooth. If supplied, all times in tt must fall within this interval (equality with limits allowed). If unsupplied, the function simply uses the range of the observed temporal values.
eta: Fixed scalar bandwidth to use for the spatial margin of the reference density estimate; if NULL it is calculated as the oversmoothing bandwidth of pp using OS. Ignored if ref.density is supplied. See `Details'.
nu: Fixed scalar bandwidth to use for the temporal margin of the reference density estimate; if NULL it is calculated from tt using the univariate version of Terrell's (1990) oversmoothing principle. Ignored if ref.density is supplied. See `Details'.
sedge: Character string dictating spatial edge correction. "uniform" (default) corrects based on evaluation grid coordinate. Setting sedge="none" requests no edge correction.
tedge: As sedge, for temporal edge correction.
ref.density: Optional. An object of class stden giving the reference density from which data is assumed to originate in the bootstrap. Must be spatially edge-corrected if sedge = "uniform".
sres: Numeric value > 0. Resolution of the [sresxsres] evaluation grid in the spatial margin.
tres: Numeric value > 0. Resolution of the evaluation points in the temporal margin as defined by the tlim interval. If unsupplied, the density is evaluated at integer values between tlim[1] and tlim[2].
start: Optional positive numeric vector of length 2 giving starting values for the internal call to optim, in the order of (, ).
verbose: Logical value indicating whether to print a function progress bar to the console during evaluation.
Details
For a spatiotemporal kernel density estimate f^ defined on WxT∈R3, the mean integrated squared error (MISE) is given by E[∫W∫T(f^(x,t)−f(x,t))2dtdx], where f is the corresponding true density. Given observed spatiotemporal locations X (arguments pp and tt) of n observations, this function finds the scalar spatial bandwidth h and scalar temporal bandwidth λ that jointly minimise
E∗[∫W∫T(f^∗(x,t)−f^(x,t))2dtdx],
where f^(x,t) is a density estimate of X constructed with reference' bandwidths $\eta$ (spatial; argument eta) and $\nu$ (temporal; argument nu); $\hat{f}^*(x,t)$ is a density estimate using bandwidths $h$ and $\lambda$ of $n$ observations $X^*$ generated from $\hat{f}(x,t)$. The notation $E^*$ denotes expectation with respect to the distribution of the $X^*$. The user may optionally supply ref.densityas an object of classstden, which must be evaluated on the same spatial and temporal domains $W$ and $T$ as the data (arguments pp, tt, and tlim). In this case, the reference bandwidths are extracted from this object, and etaandnu` are ignored.
This function is based on an extension of the theory of Taylor (1989) to the spatiotemporal domain and to cope with the inclusion of edge-correction factors. No resampling is necessary due to the theoretical properties of the Gaussian kernel.
Returns
A numeric vector of length 2 giving the jointly optimised spatial and temporal bandwidths (named h and lambda respectively).
References
Taylor, C.C. (1989) Bootstrap choice of the smoothing parameter in kernel density estimation, Biometrika, 76 , 705-712.
Author(s)
T. M. Davies
Warning
Bootstrapping for spatiotemporal bandwidth selection for spatiotemporal data is very computationally demanding. Keeping verbose = TRUE offers an indication of the computational burden by printing each pair of bandwidths at each iteration of the optimisation routine. The `Examples' section also offers some rough indications of evaluation times on this author's local machine.