bagreg {baggingbwsel}R Documentation

Bagged CV bandwidth selector for Nadaraya-Watson estimator

Description

Bagged CV bandwidth selector for Nadaraya-Watson estimator

Usage

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

Arguments

x

Covariate vector.

y

Response vector.

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 to use in cross-validation.

ncores

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

Details

Bagged cross-validation bandwidth selector for the Nadaraya-Watson estimator.

Value

Bagged CV bandwidth.

Examples

set.seed(1)
x <- rnorm(10^5)
y <- 2*x+rnorm(1e5,0,0.5)
bagreg(x, y, 1000, 10, 0.01, 1, 1000, 2)


[Package baggingbwsel version 1.0 Index]