Description Usage Arguments Value References Examples
This function computes several bandwidths for local composite quantile estimation on the boundary.
1 2 |
dat |
A list with the following components:
|
kernID |
Kernel id number. Defaults to 0.
|
left |
A logical variable that takes the value |
maxit |
Maximum iteration number in the MM algorithm for quantile estimation. Defaults to 20. |
tol |
Convergence criterion in the MM algorithm. Defaults to 1.0e-3. |
para |
A 0/1 variable specifying whether to use parallel computing. Defaults to 1. |
grainsize |
Minimum chunk size for parallelization. Defaults to 1. |
llr.residuals |
Whether to use residuals from the local linear regression
as the input to compute the LCQR standard errors and the corresponding
bandwidths. Defaults to |
ls.derivative |
Whether to use a global quartic and quintic polynomial to
estimate the second and third derivatives of the conditional mean function.
Defaults to |
h_cqr
returns a list with the following components:
h_mse |
MSE-optimal bandwidth on the boundary. This bandwidth has order O(n^{-1/5}), where n is the sample size for data either below or above the cutoff. |
h_opt |
Bandwidth based on the adjusted MSE on the boundary. See Huang and Zhan (2020) for details about the adjusted MSE. This bandwidth has order O(n^{-1/7}), where n is the sample size for data either below or above the cutoff. |
h_rot |
A transform of the rule-of-thumb bandwidth for the local linear regression. The rule-of-thumb bandwidth is close to the Mean Integrated Squared Error optimal (MISE-optimal) bandwidth in a local linear regression. This bandwidth has order O(n^{-1/5}), where n is the sample size for data either below or above the cutoff. |
Huang and Zhan (2021) "Local Composite Quantile Regression for Regression Discontinuity," working paper.
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 | ## Not run:
# Use the headstart data.
data(headstart)
data_n = subset(headstart, headstart$poverty < 0)
p = 1
q = 5
tau = (1:q) / (q + 1)
x = headstart$poverty
h_d0 = ks::hns(x, deriv.order = 0)
f0_hat = ks::kdde(x, h = h_d0, deriv.order = 0, eval.points = c(0))$estimate
h_d1 = ks::hns(x, deriv.order = 1)
fd1 = ks::kdde(x, h = h_d1, deriv.order = 1, eval.points = c(0))$estimate
# Set up the list to be passed to the h_cqr function.
# Supply a bandwidth that is equal to 3.5.
dat_n = list("x" = data_n$poverty,
"y" = data_n$mortality,
"q" = q,
"h" = 3.5,
"tau" = tau,
"p" = p,
"n_all" = n_all,
"f0_hat" = f0_hat,
"fd1" = fd1)
# Use the residuals from local linear regression for a quick try.
h_cqr(dat = dat_n, llr.residuals = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.