opt_w: Optimal weights

Description Usage Arguments Value

View source: R/optimaztion.R

Description

Solve for optimal weigths by the quantile matching method

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
opt_w(
  method,
  C.vec,
  y,
  x,
  d = NULL,
  eval,
  T.grad.mat,
  level,
  deg,
  kern,
  M,
  seed = NULL,
  useloop = TRUE,
  root.robust = FALSE,
  ng = 10,
  resid.1 = NULL,
  resid.0 = NULL,
  var.reg = "npr",
  c.method = "supp2",
  c.supp = NULL
)

Arguments

method

character string used to define the parameter of interest and the function space. Possible choices are

"reg.Hol"

Regression function values under Hölder space

"reg.Lip"

Regression function values under Lipschitz space

"TE.Lip"

CATE under Lipschitz space

"TE.Lip.eqbw"

CATE under Lipschitz space using the same bandwidths for the treatment and the control groups

"TE.Lip"

CATE under Hölder space

"TE.Lip.eqbw"

CATE under Hölder space using the same bandwidths for the treatment and the control groups

C.vec

smoothness parameter for the function space; possibly a vector.

y

dependent variable; possibly a matrix with nrow(y) equals the number of observations.

x

a vector of independent variable

d

a vector of treatment indicator; it can be arbitrarily specified when not used.

eval

a vector of indices

T.grad.mat

A n.T by k dimensional gradient matrix of T_t f for t = 1,..., n.T.

level

level of quantile

deg

degree of local polynomial regression to be used

kern

kernel used to calculate conditional variance function; supports "tri", "epa", "uni", and "gau". Default is kern = "epa".

M

number of bootstrap simulations

seed

seed for the random number generation; default is seed = NULL.

useloop

If TRUE, the function is implemented by for loop over t = 1,..., n.T; currently only useloop = TRUE is implemented.

root.robust

if TRUE, the fuction conducts diagnostic test whether optimizaiton worked well; default is root.robust = FALSE. Currently, this feature is obsolete.

ng

the number of grids of quantile values over which the diagnostic test would be peformed if root.robust = TRUE; default is ng = 10. Currently, this feature is obsolete.

resid.1

residuals corresponding to the treated observations; it can be a vector or a matrix if ncol(y) > 1. For treatment effect models, its ith component corresponds to the ith component of y[d == 1, ]. If there are no treatment and control groups, resid.1 corresponds to residuals for the entire observations. It can be specified to be NULL.

resid.0

residuals corresponding to the control observations; it can be a vector or a matrix if ncol(y) > 1. Its ith component corresponds to the ith component of y[d == 0, ]. It can be specified to be NULL.

var.reg

nonparametric regression method used to calculate residuals; either "npr" (standing for nprobust package) or "locpol" (standing for locpol package). Default is var.reg = "npr".

c.method

method to calculate the optimal value of c_n. Currently, using the default value c.method = "supp2" is recommended and other options are obsolete.

c.supp

value of c_n to be used when c.method = "supp"; default is c.supp = NULL.

Value

a list of the following components

w.1

a 3-dim array of weigths corresponding to the treated observations; the second and third dimension correponds to ncol(y) and length(eval)

w.0

a 3-dim array of weigths corresponding to the control observations; the second and third dimension correponds to ncol(y) and length(eval). If there is no control observations, returns array of 0.

c.root

the quantile value corresponding to the optimal weigths.

increasing

boolean value testing whether the objective function is increasing or not; provided only if root.robust = TRUE

opt.grid

a data.frame object containing evaluations of the objective function over grid values of quantiles; provided only if root.robust = TRUE


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