Learn R Programming

baggingbwsel (version 1.1)

bagcv: Bagged CV bandwidth selector for Parzen-Rosenblatt estimator

Description

Bagged CV bandwidth selector for Parzen-Rosenblatt estimator

Usage

bagcv(x, r, s, h0, h1, nb = r, ncores = parallel::detectCores())

Value

Bagged CV bandwidth.

Arguments

x

Vector. Sample.

r

Positive integer. Size of the subsamples.

s

Positive integer. Number of subsamples.

h0

Positive real number. Range over which to minimize, left bound.

h1

Positive real number. Range over which to minimize, right bound.

nb

Positive integer. Number of bins.

ncores

Positive integer. Number of cores with which to parallelize the computations.

Details

Bagged cross-validation bandwidth selector for the Parzen-Rosenblatt estimator.

Examples

Run this code
set.seed(1)
x <- rnorm(10^6)
bagcv(x, 5000, 100, 0.01, 1, 1000, 2)

Run the code above in your browser using DataLab