View source: R/LSCV.spattemp.R
LIK.spattemp | R Documentation |
Bandwidth selection for standalone spatiotemporal density/intensity based on either unbiased least squares cross-validation (LSCV) or likelihood (LIK) cross-validation, providing an isotropic scalar spatial bandwidth and a scalar temporal bandwidth.
LIK.spattemp(pp, tt = NULL, tlim = NULL, sedge = c("uniform", "none"),
tedge = sedge, parallelise = NA, start = NULL, verbose = TRUE)
LSCV.spattemp(pp, tt = NULL, tlim = NULL, sedge = c("uniform", "none"),
tedge = sedge, sres = 64, tres = sres, parallelise = NA,
start = NULL, verbose = TRUE)
pp |
An object of class |
tt |
A numeric vector of equal length to the number of points in |
tlim |
A numeric vector of length 2 giving the limits of the temporal domain over which to smooth. If supplied, all times in |
sedge |
Character string dictating spatial edge correction. |
tedge |
As |
sres |
Numeric value > 0. Resolution of the [ |
tres |
Numeric value > 0. Resolution of the evaluation points in the temporal margin as defined by the |
parallelise |
Optional numeric argument to invoke parallel processing, by giving the number of CPU cores to use optimisation. This is only useful for larger data sets of many thousand observations. Experimental. Test your system first using |
start |
Optional positive numeric vector of length 2 giving starting values for the internal call to |
verbose |
Logical value indicating whether to print a function progress bar to the console during evaluation. |
A numeric vector of length 2 giving the jointly optimised spatial and temporal bandwidths (named h
and lambda
respectively).
Leave-one-out CV for bandwidth selection in kernel density estimation is notoriously unstable in practice and has a tendency to produce rather small bandwidths in the fixed bandwidth case. Satisfactory bandwidths are not guaranteed for every application. This method can also be computationally expensive for large data sets and fine evaluation grid resolutions.
T. M. Davies
Silverman, B.W. (1986), Density Estimation for Statistics and Data Analysis, Chapman & Hall, New York.
BOOT.spattemp
, spattemp.density
data(burk) # Burkitt's Uganda lymphoma data
burkcas <- burk$cases
hlam1 <- LSCV.spattemp(burkcas) #~9 secs
hlam2 <- LSCV.spattemp(burkcas,tlim=c(400,5800))
hlam3 <- LSCV.spattemp(burkcas,start=c(7,400))
rbind(hlam1,hlam2,hlam3)
hlam1 <- LIK.spattemp(burkcas) #~3 secs
hlam2 <- LIK.spattemp(burkcas,tlim=c(400,5800))
hlam3 <- LIK.spattemp(burkcas,start=c(7,400))
rbind(hlam1,hlam2,hlam3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.