ivqr_confint: Compute the confidence interval for Betaj

Description Usage Arguments Value Examples

View source: R/ivqr_confint.R

Description

This function is an internal function called inside function "ivqr_fit()"

Usage

1
2
3
4
ivqr_confint(test_stat = test_stat_freq_D, j = 1, B = NULL,
  Phi = NULL, Beta_j_hat = 1, Srate = 1/2, alpha = 0.1, Y, D, X, Z,
  tau = 0.5, width_ratio = 1, M = 10, homoskedastic = FALSE,
  kernel = "Powell", lpsolver = NULL)

Arguments

D

data for endogenous variable D

X

data for exogenous variable X

Z

data for instrumental variable Z

tau

tau in quantile regression

M

a large number

lpsolver

"gurobi","cplexapi","lpsolveapi"

Value

the estimates, upper bound and lower bound

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
n=50
pD=3
sample_data<-chen_lee(n,pD)
Y=sample_data$Y
D=sample_data$D
Z=sample_data$Z
X = matrix(1, n, 1)
XZ = cbind(X, Z)
PI_XZ = XZ %*% solve(t(XZ) %*% XZ) %*% t(XZ)
Phi_CH = PI_XZ %*% D
lpsolver="gurobi"
tau = 0.5
iqr_milp_fit = iqr_milp(Y, D, X, Z, tau = tau, lpsolver = lpsolver)
B_D_hat = iqr_milp_fit$B_D
J=1
ivqr_confint(
test_stat = test_stat_freq_D,
j = J,
B = Phi_CH[, J, drop = FALSE],
Phi = Phi_CH[, -J, drop = FALSE],
Beta_j_hat = B_D_hat[J],
Srate = 1 / 2,
alpha = 0.1,
Y=Y,
D=D,
X=X,
Z=Z,
tau = tau,
M = 10,
homoskedastic = FALSE,
kernel = "Gaussian",
lpsolver = lpsolver
)

ChenyueLiu/ivqr documentation built on Aug. 9, 2020, 7:49 p.m.