hdrbs: Calculate the optiaml bandwidth matrix for highest density...

Description Usage Arguments Value References Examples

View source: R/main_fun.R

Description

This function allow you to compute the optiaml bandwidth matrix for highest density region estimation by using a plug-in strategy.

Usage

1
2
hdrbs(X, tau, xrange, yrange, gridwidth, init = NULL, maxit = 200,
  tol = 1e-06, print_obj = FALSE)

Arguments

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., c(xmin, xmax), indicating the range the grid points to be generated on x-axis

yrange

a vector of of length 2, e.g., c(ymin, ymax), indicating the range the grid points to be generated on y-axis

gridwidth

width between grid points.

init

starting value of the bandwidth matrix for optimization. If not specified, use direct-plug estimator from ks package as starting value

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.

Value

the optimal bandwidth matrix.

References

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.

Examples

1
2
3
4
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)

lsbs documentation built on May 2, 2019, 7:58 a.m.

Related to hdrbs in lsbs...