Title: | Bandwidth Selection for Level Sets and HDR Estimation |
---|---|
Description: | Bandwidth selection for kernel density estimators of 2-d level sets and highest density regions. It applies a plug-in strategy to estimate the asymptotic risk function and minimize to get the optimal bandwidth matrix. See Doss and Weng (2018) <arXiv:1806.00731> for more detail. |
Authors: | Guangwei Weng [aut, cre] |
Maintainer: | Guangwei Weng <[email protected]> |
License: | GPL-3 |
Version: | 0.1 |
Built: | 2025-03-06 03:01:43 UTC |
Source: | https://github.com/weng-gw/lsbs |
This function allow you to compute the optiaml bandwidth matrix for highest density region estimation by using a plug-in strategy.
hdrbs(X, tau, xrange, yrange, gridwidth, init = NULL, maxit = 200, tol = 1e-06, print_obj = FALSE)
hdrbs(X, tau, xrange, yrange, gridwidth, init = NULL, maxit = 200, tol = 1e-06, print_obj = FALSE)
X |
a matrix with two columns containing the data from the density function. |
tau |
a probability value between 0 and 1 |
xrange |
a vector of of length 2, e.g., |
yrange |
a vector of of length 2, e.g., |
gridwidth |
width between grid points. |
init |
starting value of the bandwidth matrix for
optimization. If not specified, use direct-plug estimator from
|
maxit |
maximum number of iterations for optimization |
tol |
tolerance value for stopping the optimization algorithm |
print_obj |
a flag (boolean type) indicates printing the loss function values during optimizatin or not. |
the optimal bandwidth matrix.
Doss, C.R. and Weng, G., 2018. Bandwidth selection for kernel density estimators of multivariate level sets and highest density regions. arXiv preprint arXiv:1806.00731.
X <- matrix(rnorm(100),ncol=2) xrange <- c(-2.5,2.5) yrange <- c(-2.5,2.5) hdrbs(X,0.1,xrange,yrange,0.1)
X <- matrix(rnorm(100),ncol=2) xrange <- c(-2.5,2.5) yrange <- c(-2.5,2.5) hdrbs(X,0.1,xrange,yrange,0.1)
This function allow you to compute the optiaml bandwidth matrix for level set estimation by using a plug-in strategy.
lsbs(X, levelc, xrange, yrange, gridwidth, init = NULL, maxit = 200, tol = 1e-06, print_obj = FALSE)
lsbs(X, levelc, xrange, yrange, gridwidth, init = NULL, maxit = 200, tol = 1e-06, print_obj = FALSE)
X |
a matrix with two columns containing the data from the density function. |
levelc |
a positive value indicating the height of the level set |
xrange |
a vector of of length 2, e.g., |
yrange |
a vector of of length 2, e.g., |
gridwidth |
width between grid points. |
init |
starting value of the bandwidth matrix for
optimization. If not specified, use direct-plug estimator from
|
maxit |
maximum number of iterations for optimization |
tol |
tolerance value for stopping the optimization algorithm |
print_obj |
a flag (boolean type) indicates printing the loss function values during optimizatin or not. |
the optimal bandwidth matrix.
Doss, C.R. and Weng, G., 2018. Bandwidth selection for kernel density estimators of multivariate level sets and highest density regions. arXiv preprint arXiv:1806.00731.
X <- matrix(rnorm(100),ncol=2) xrange <- c(-3,3) yrange <- c(-3,3) lsbs(X,0.1,xrange,yrange,0.05)
X <- matrix(rnorm(100),ncol=2) xrange <- c(-3,3) yrange <- c(-3,3) lsbs(X,0.1,xrange,yrange,0.05)