powered by
Bagged CV bandwidth selector for local polynomial kernel regression.
bagreg( x, y, r, s, h0, h1, nb = r, ncores = parallel::detectCores(), poly.index = 0 )
Bagged CV bandwidth.
Covariate vector.
Response vector.
Positive integer. Size of the subsamples.
Positive integer. Number of subsamples.
Positive real number. Range over which to minimize, left bound.
Positive real number. Range over which to minimize, right bound.
Positive integer. Number of bins to use in cross-validation.
Positive integer. Number of cores with which to parallelize the computations.
Non-negative integer defining local constant (0) or local linear (1) smoothing. Default value: 0 (Nadaraya-Watson estimator).
Bagged cross-validation bandwidth selector for local polynomial kernel regression.
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)
Run the code above in your browser using DataLab