w_get_Lip: Optimal weights for Lipschitz space

Description Usage Arguments Value Examples

View source: R/weights.R

Description

Computes optimal weights and bandwidths for inference for nonparametric regression function values under Lipschitz space.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
w_get_Lip(
  y,
  x,
  eval,
  C,
  level,
  TE = FALSE,
  d = NULL,
  kern = "tri",
  bw.eq = TRUE
)

Arguments

y

vector of dependent variables

x

a vector of regressors.

eval

evaluation points

C

bound on the second derivative

level

confidence level of each one-sided confidence intervals

TE

logical specifying whether there are treatment and control groups.

d

a vector of indicator variables specifying treatment and control group status; relevant only when TE = TRUE.

kern

a string for kernel name; currently "tri" is supported.

bw.eq

if TRUE, the same bandwidths are used for estimators for treatment and control groups; relevant only when TE = TRUE.

Value

a matrix of weights with each column corresponding to weights for each evaluation points, or if TE = TRUE, a list of two such matrices, with w.mat.1 corresponding to that of the treated group and w.mat.0 corresponding to that of the control group.

Examples

1
2
3
4
x <- stats::runif(500, min = -1, max = 1)
y <- x + rnorm(500, 0, 1/4)
eval <- seq(from = -0.9, to = 0.9, length.out = 5)
w_get_Lip(y, x, eval, 1, 0.95)

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