Type: | Package |
Title: | Bandwidth Selectors for Local Linear Quantile Regression |
Version: | 0.1.0 |
Date: | 2022-01-31 |
Depends: | R (≥ 2.6), quantreg, KernSmooth, nleqslv |
Description: | Bandwidth selectors for local linear quantile regression, including cross-validation and plug-in methods. The local linear quantile regression estimate is also implemented. |
Language: | en-GB |
License: | GPL-2 |
Encoding: | UTF-8 |
Biarch: | true |
NeedsCompilation: | yes |
Packaged: | 2022-02-07 16:24:41 UTC; mercedes |
Author: | Mercedes Conde-Amboage
|
Maintainer: | Mercedes Conde-Amboage <mercedes.amboage@usc.es> |
Repository: | CRAN |
Date/Publication: | 2022-02-08 16:00:11 UTC |
Bandwidth selectors for local linear quantile regression
Description
The R package BwQuant
implements different bandwidth selectors for local linear quantile regression, including selectors based on rule of thumb, plug-in and cross-validation tecniques.
Author(s)
Mercedes Conde-Amboage <mercedes.amboage@usc.es> and Cesar Sanchez-Sellero <cesar.sanchez@usc.es>
Maintainer: Mercedes Conde-Amboage <mercedes.amboage@usc.es>
Computing the cross-validation bandwidth proposed by Abberger (1998)
Description
Function to compute a bandwidth for local linear quantile regression following the cross-validation criteria presented by Abberger (1998).
Usage
bwCV(x, y, hseq, tau)
Arguments
x |
numeric vector of |
y |
numeric vector of |
hseq |
sequence of values where the cross-validation function will be evaluated. |
tau |
the quantile order where the regression function is to be estimated. It must be a number strictly between 0 and 1. |
Details
The cross-validation function is evaluated at each element of hseq
. Then, the cross-validation selector will be the element of hseq
that minimizes the cross-validation function.
Value
Returns a number with the chosen bandwidth.
Author(s)
Mercedes Conde-Amboage and Cesar Sanchez-Sellero.
References
Abberger, K. (1998). Cross-validation in nonparametric quantile regression. Allgemeines Statistisches Archiv, 82, 149-161.
Abberger, K. (2002). Variable data driven bandwidth choice in nonparametric quantile regression. Technical Report.
See Also
The obtained bandwidth can be used in the function llqr
to produce a local linear estimate of the tau
-quantile regression function.
Examples
set.seed(1234)
x=runif(100)
y=10*(x^4+x^2-x)+rexp(100)
hseq=seq(0.05,0.8,length=21)
tau=0.25
bwCV(x,y,hseq,tau)
Computing the plug-in bandwidth proposed by Conde-Amboage and Sanchez-Sellero (2018)
Description
Function to compute a bandwidth selector for local linear quantile regression following the plug-in rule proposed in Section 2.2 of Conde-Amboage and Sanchez-Sellero (2018).
Usage
bwPI(x, y, tau)
Arguments
x |
numeric vector of |
y |
numeric vector of |
tau |
the quantile order where the regression function is to be estimated. It must be a number strictly between 0 and 1. |
Value
Returns a bandwidth for a local linear estimate of the tau
-quantile regression function.
Author(s)
Mercedes Conde-Amboage and Cesar Sanchez-Sellero.
References
Conde-Amboage, M. and Sanchez-Sellero, C. (2018). A plug-in bandwidth selector for nonparametric quantile regression. TEST, 28, 423-450. <doi:10.1007/s11749-018-0582-6>.
See Also
The obtained bandwidth can be used in the function llqr
to produce a local linear estimate of the tau
-quantile regression function.
Examples
set.seed(1234)
x=runif(100)
y=10*(x^4+x^2-x)+rexp(100)
tau=0.25
bwPI(x,y,tau)
Computing a bandwidth using a rule of thumb
Description
Function to compute a bandwidth selector for local linear quantile regression following the rule of thumb presented in Section 2.1 of Conde-Amboage and Sanchez-Sellero (2018).
Usage
bwRT(x, y, tau)
Arguments
x |
numeric vector of |
y |
numeric vector of |
tau |
the quantile order where the regression function is to be estimated. It must be a number strictly between 0 and 1. |
Value
Returns a bandwidth for a local linear estimate of the tau
-quantile regression function.
Author(s)
Mercedes Conde-Amboage and Cesar Sanchez-Sellero.
References
Conde-Amboage, M. and Sanchez-Sellero, C. (2018). A plug-in bandwidth selector for nonparametric quantile regression. TEST, 28, 423-450. <doi:10.1007/s11749-018-0582-6>.
See Also
The obtained bandwidth can be used in the function llqr
to produce a local linear estimate of the tau
-quantile regression function.
Examples
set.seed(1234)
x=runif(100)
y=10*(x^4+x^2-x)+rexp(100)
tau=0.25
bwRT(x,y,tau)
Computing the plug-in bandwidth proposed by Yu and Jones (1998)
Description
Function to compute a bandwidth selector for local linear quantile regression following the plug-in rule proposed by Yu and Jones (1998).
Usage
bwYJ(x, y, tau)
Arguments
x |
numeric vector of |
y |
numeric vector of |
tau |
the quantile order where the regression function is to be estimated. It must be a number strictly between 0 and 1. |
Value
Returns a bandwidth for a local linear estimate of the tau
-quantile regression function.
Author(s)
Mercedes Conde-Amboage and Cesar Sanchez-Sellero.
References
Ruppert, D., Sheather, S. J. and Wand, M. P. (1995). An efective bandwidth selector for local least squares regression. Journal of the American Statistical Association. 90, 1257-1270.
Yu, K. and Jones, M. C. (1998). Local linear quantile regression. Journal of the American Statistical Association, 93, 228-237.
See Also
The obtained bandwidth can be used in the function llqr
to produce a local linear estimate of the tau
-quantile regression function.
Examples
set.seed(1234)
x=runif(100)
y=10*(x^4+x^2-x)+rexp(100)
tau=0.25
bwYJ(x,y,tau)
Fitting a local linear quantile regression model
Description
Function that estimates the quantile regression function using a local linear kernel smoother.
Usage
llqr(x, y, tau, t, h)
Arguments
x |
numeric vector of |
y |
numeric vector of |
tau |
the quantile order where the regression function is to be estimated. It must be a number strictly between 0 and 1. |
t |
the values of |
h |
the bandwidth parameter. |
Value
A list with the following components:
x.values |
the given points at which the evaluation occurs. |
y.values |
the estimated values of the quantile regression function at the given |
Author(s)
Mercedes Conde-Amboage and Cesar Sanchez-Sellero.
References
Fan, J., Hu, T. C. and Truong, Y. K. (1994). Robust nonparametric function estimation. Scandinavian Journal of Statistics, 21, 433-446.
Yu, K. and Jones, M. C. (1998). Local linear quantile regression. Journal of the American Statistical Association, 93, 228-237.
See Also
The argument h
with the bandwidth parameter can be fixed to some arbitrary value or chosen by one of the procedures implemented in the functions bwCV
, bwPI
, bwRT
or bwYJ
.
Examples
set.seed(1234)
x=runif(100)
y=10*(x^4+x^2-x)+rexp(100)
tau=0.25
h=bwPI(x,y,tau)
t=seq(0,1,length=101)
m=llqr(x,y,tau,t,h)
plot(x,y)
lines(m$x.values,m$y.values)