computeBandwidth {RDM} | R Documentation |
Compute bandwidth via cross-validation
Description
An implementation of the cross-validation principle for the bandwidth selection as presented in Strothmann, Dette and Siburg (2022) <arXiv:2201.03329>.
Usage
computeBandwidth(X, sL, sU, method = c("cvsym", "cvasym"), reduce = TRUE)
Arguments
X |
A bivariate data.frame containing the observations. Each row contains one observation. |
sL |
Lower bound |
sU |
Upper bound |
method |
"cvsym" uses either a symmetric cross-validation principle (N_1 = N_2) and "cvasym" uses an asymmetric cross-validation principle (i.e. |
reduce |
In case reduce is set to TRUE, the parameter is chosen from N, N+2, ... instead of N, N+1, N+2, ... |
Details
This function computes the optimal bandwidth given the bivariate observations X
of length N
.
Currently, there are two different algorithms implemented:
"cvsym" - Computes the optimal bandwidth choice for a square checkerboard mass density according to the cross-validation principle. The bandwidth is a natural number between
N^{sL}, ..., N^{sU}
"cvasym" - Computes the optimal bandwidth choice
(N_1, N_2)
for a non-square checkerboard mass density according to the cross-validation principle. The bandwidthsN_1, N_2
are natural numbers betweenN^{sL}, ..., N^{sU}
and may possibly attain different values.
Value
The chosen bandwidth depending on the data.frame X.
Examples
n <- 20
X <- cbind(runif(n), runif(n))
computeBandwidth(X, sL = 0.25, sU = 0.5, method="cvsym", reduce=TRUE)