debiased_local_linear: Debiased local-linear regression and confidence bands

View source: R/regression.R

debiased_local_linearR Documentation

Debiased local-linear regression and confidence bands

Description

Fit the debiased local-linear estimator in equation (5) of Cheng and Chen or construct its paired-bootstrap simultaneous confidence band (Figure 3).

Usage

debiased_local_linear(x, y, points = NULL, bandwidth = NULL, tau = 1,
  grid_size = 200L, n_folds = 5L, random_state = 0L)

regression_confidence_band(x, y, points = NULL, bandwidth = NULL,
  tau = 1, confidence = 0.95, n_boot = 999L, random_state = NULL,
  grid_size = 200L, n_folds = 5L, max_attempts = NULL)

Arguments

x

Numeric one-dimensional covariates.

y

Numeric responses of the same length as x.

points

Optional numeric evaluation grid.

bandwidth

Positive bandwidth selected for the ordinary smoother.

tau

Positive ratio h/b; the paper recommends one.

grid_size

Generated grid size when points is omitted.

n_folds

Number of cross-validation folds for bandwidth selection.

random_state

Optional local random seed.

confidence

Confidence level strictly between zero and one.

n_boot

Positive number of paired-bootstrap replicates.

max_attempts

Maximum resamples attempted if singular fits occur.

Value

A di_estimate or di_band object.

References

Cheng, G. and Chen, Y.-C. (2019). Nonparametric Inference via Bootstrapping the Debiased Estimator. Electronic Journal of Statistics, 13(1). \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/19-EJS1575")}.

Examples

x <- seq(-1, 1, length.out = 50)
y <- sin(pi * x) + rnorm(50, sd = 0.1)
fit <- debiased_local_linear(x, y, bandwidth = 0.3)
band <- regression_confidence_band(x, y, bandwidth = 0.3,
                                   n_boot = 19, random_state = 1)

debiasedInference documentation built on Sept. 29, 2026, 5:09 p.m.