w_get_Hol: Optimal weights for Hölder 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 Hölder space, with an aid of RDHonest package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
w_get_Hol(
  y,
  x,
  eval,
  C,
  level,
  kern = "triangular",
  se.initial = "EHW",
  se.method = "nn",
  J = 3,
  TE = FALSE,
  d = NULL,
  bw.eq = TRUE
)

Arguments

y

vector of dependent variables

x

vector of regressors

eval

evaluation points

C

bound on the second derivative

level

confidence level

kern

specifies kernel function used in the local regression; default = "triangular". See NPROptBW.fit in RDHonest package for a list of kernels available.

se.initial

method for estimating initial variance for computing optimal bandwidt; default = "EHW". See NPROptBW.fit in RDHonest package for a list of method available.

se.method

methods for estimating standard error of estimate; default = "nn". See NPRreg.fit in RDHonest package for a list of method available.

J

number of nearest neighbors, if "nn" is specified in se.method.

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.

bw.eq

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

Value

list with components

w.mat

matrix of optimal weigths with a dimension length(y) by length(eval) corresponding to the evaluation points

bw.vec

vector of optimal bandwidths corresponding to the evaluation points

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_Hol(y, x, eval, 1, 0.95)

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