CB_RBC: Confidence Band Using Bootstrap

Description Usage Arguments Details Value References Examples

View source: R/ChengChen.R

Description

Genereates a confidence band using the procedure described in Cheng and Chen (2019).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
CB_RBC(
  y,
  x,
  eval,
  B = 1000,
  level = 0.95,
  fixed = TRUE,
  bwselect = "mse-dpi",
  C = NULL
)

Arguments

y

dependent variable.

x

independent variable.

eval

vector of evaluation points.

B

number of bootstrap simulations; default is B = 1000.

level

confidence level used for confidence band; default is level = 0.95.

fixed

calculates the fixed length if TRUE; otherwise, CB is calculated according to Remark 2 of Cheng and Chen (2019).

bwselect

bandwidth selection method of lprobust; default is "mse-dpi". Another option is "bw.honest", which uses the bandwidth calculated by HTEBand package.

C

bound on the second derivative; only relevant when bwselect = "bw.honest".

Details

B = 1000 is used in Cheng and Chen (2019).

Value

a data frame containing index set and corresponding confidence band values

References

Cheng, G., and Y.-C. Chen. 2019. "Nonparametric inference via bootstrapping the debiased estimator." Electronic Journal of Statistics, 13 (1): 2194–2256.

Examples

1
2
3
4
5
6
x <- stats::runif(500, min = -1, max = 1)
y <- x + rnorm(500, 0, 1/4)
eval <- seq(from = -1, to = 1, length.out = 20)
CB_RBC(y, x, eval, 2)
CB_RBC(y, x, eval, 2, fixed = FALSE)
CB_RBC(y, x, eval, 2, fixed = FALSE, bwselect = "bw.honest", C = 1)

koohyun-kwon/HTEBandSim documentation built on Dec. 21, 2021, 7:43 a.m.