Bandwidth Selection for Location-Scale Kernel Quantile Regression
nplsqregbw.Rdnplsqregbw selects bandwidths and the scalar location-scale shift
parameter delta for nplsqreg by minimizing
leave-one-out check loss.
Usage
nplsqregbw(bws, ...)
# S3 method for class 'formula'
nplsqregbw(bws, data = NULL, tau = 0.5,
subset, na.action, ...)
# S3 method for class 'lsqregressionbandwidth'
nplsqregbw(bws, tau = bws$tau, ...)
# Default S3 method
nplsqregbw(bws,
xdat = stop("invoked without data 'xdat'"),
ydat = stop("invoked without data 'ydat'"),
tau = 0.5,
tau.search = c("full", "refined"),
delta = NULL,
scale = NULL,
regtype = c("lc", "ll", "lp"),
regtype.pilot = c("auto", "ll", "lc", "lp"),
nomad = FALSE,
nomad.pilot = FALSE,
pilot.args = list(),
bandwidth.compute = TRUE,
delta.bounds = c(1e-4, 1 - 1e-4),
optim.control = list(maxit = 50L),
...)Arguments
Data, Bandwidth Inputs And Formula Interface
These arguments identify the bandwidth specification, formula/data interface, and training data.
- bws
a formula, an
lsqregressionbandwidthobject, anrbandwidthobject, a numeric bandwidth vector, or omitted for automatic selection. Ordinarynpregbwrbandwidthobjects may be used as starting values. Exact nplsqreg reuse is through anlsqregressionbandwidthobject, typicallyfit$bws;fit$reg.bwsis internal regression state.- data
an optional data frame, list or environment containing the variables in the model. If not found in
data, the variables are taken fromenvironment(bws).- subset
an optional vector specifying a subset of observations to be used by the formula method.
- na.action
a function specifying the action to take when missing values are found by the formula method.
- xdat
a \(p\)-variate data frame of explanatory data used as training data.
- ydat
a one dimensional numeric vector of dependent data.
Quantile Index And Vector-Tau Search
These arguments identify the quantile probabilities and how vector-tau
fits are orchestrated.
- tau
a numeric scalar or vector specifying the quantile probability or probabilities \(\tau\). Values must lie strictly in \((0,1)\).
- tau.search
either
"full"or"refined". The default"full"route performs a full bandwidth/deltasearch for eachtau, sharing only the pilot scale. The explicit"refined"route fits the centraltaufirst and uses the resulting bandwidths,delta, and when applicable selected degree vector as warm starts for the remaining quantiles.
Scale Pilot
These arguments control or supply the conditional standard deviation used in the location-scale transformation.
- scale
an optional strictly positive scale vector interpreted as the conditional standard deviation at the training observations. If omitted, a pilot scale is computed automatically.
- regtype.pilot
regression type used for the pilot mean and residual-variance smooths. The default
"auto"uses local linear smoothing when continuous predictors are present and local constant smoothing for categorical-only designs.- nomad.pilot
logical value indicating whether the pilot regressions should use the automatic NOMAD local-polynomial route when compatible with
regtype.pilot. Defaults toFALSE.- pilot.args
optional named list of additional arguments supplied to the pilot
npregcalls.
Bandwidth, Delta And Degree Search
These arguments control the main check-loss bandwidth and
delta optimization.
- regtype
regression type for the main transformed-response fit and check-loss bandwidth search. This is independent of
regtype.pilotand followsnpregbwsemantics.- delta
optional starting value for the shift parameter. If omitted, the first start uses
0.5; subsequent multistarts draw starting values from \((0,1)\).- delta.bounds
two numeric values giving the lower and upper bounds for
delta. The interval must lie strictly inside \((0,1)\).- nomad
logical value indicating whether to use the local-polynomial NOMAD route for joint bandwidth,
delta, and continuous degree-vector search. Defaults toFALSE.- bandwidth.compute
logical value indicating whether automatic bandwidth selection should be performed. Defaults to
TRUE.- optim.control
a list of controls passed to the Powell optimizer used for fixed degree searches and NOMAD hot-start refinement.
- ...
additional bandwidth, kernel, local-polynomial, and search controls forwarded to the package bandwidth machinery. Common examples include
regtype,bwtype,bwmethod,nmulti,degree,basis,bernstein.basis,search.engine,degree.min,degree.max,degree.start,degree.restarts,powell.remin,nomad.remin, andnomad.nmulti. The explanatory-variable kernel aliases used bynpqregandnpcdistbw, such ascxkertype,cxkerorder,uxkertype, andoxkertype, are accepted and mapped to the corresponding regression-kernel controls. Response-side conditional-distribution kernel controls such ascykertypeare not meaningful for the location-scale transformed-response estimator and fail clearly rather than being ignored.
Details
For a requested quantile probability \(\tau\),
nplsqregbw chooses bandwidths and delta for the
transformed response
$$
Y_i^\delta = Y_i + \hat\sigma(X_i)\Phi^{-1}(\delta)
$$
by minimizing the leave-one-out check loss. The selected bandwidths
are then used by nplsqreg for the final mixed-data
npreg fit of the transformed response.
The default pilot scale is a residual scale: first npreg
estimates the conditional mean, then npreg smooths
squared residuals using the same bandwidth object, and the square root
of the floored fitted variance is used as the scale. The local-linear
pilot option follows Fan and Yao (1998). A user-supplied scale
must be strictly positive and is interpreted as a conditional standard
deviation, not a variance.
When nomad=TRUE, the search can include the continuous
local-polynomial degree vector in addition to bandwidths and
delta. The search.engine="nomad+powell" route uses NOMAD
for degree search and Powell for hot-start refinement at the selected
degree.
Value
nplsqregbw returns an object of class
lsqregressionbandwidth. For vector tau, the object stores
the per-tau bandwidth objects, selected delta values,
objectives, fit order, warm-start provenance, and shared pilot scale.
References
Fan, J. and Q. Yao (1998), “Efficient Estimation of Conditional Variance Functions in Stochastic Regression,” Biometrika, 85, 645-660. doi:10.1093/biomet/85.3.645
Racine, J.S. and K. Li (2017), “Nonparametric conditional quantile estimation: A locally weighted quantile kernel approach,” Journal of Econometrics, 201, 72-94. doi:10.1016/j.jeconom.2017.06.020
Racine, J.S. and I. Van Keilegom (2020), “A smooth nonparametric, multivariate, mixed-data location-scale test,” Journal of Business & Economic Statistics, 38, 784-795. doi:10.1080/07350015.2019.1574227
Author
Tristen Hayfield tristen.hayfield@gmail.com, Jeffrey S. Racine racinej@mcmaster.ca