Title: | Block Bootstrap Methods for Quantile Regression in Time Series |
---|---|
Description: | Implements moving-blocks bootstrap and extended tapered-blocks bootstrap, as well as smooth versions of each, for quantile regression in time series. This package accompanies the paper: Gregory, K. B., Lahiri, S. N., & Nordman, D. J. (2018). A smooth block bootstrap for quantile regression with time series. The Annals of Statistics, 46(3), 1138-1166. |
Authors: | Karl Gregory |
Maintainer: | Karl Gregory <[email protected]> |
License: | GPL-3 |
Version: | 1.0.0 |
Built: | 2025-03-05 03:31:18 UTC |
Source: | https://github.com/gregorkb/qregbb |
Implements moving-blocks bootstrap and extended tapered-blocks bootstrap, as well as smooth versions of each, for quantile regression in time series. This package accompanies the paper: Gregory, K. B., Lahiri, S. N., & Nordman, D. J. (2018). A smooth block bootstrap for quantile regression with time series. The Annals of Statistics, 46(3), 1138-1166.
Implements moving-blocks bootstrap and extended tapered-blocks bootstrap, as well as smooth versions of each, for quantile regression in time series. This package accompanies Gregory et al. (2018).
Package: | QregBB |
Type: | Package |
Title: | Block Bootstrap Methods for Quantile Regression in Time Series |
Version: | 1.0.0 |
Date: | 2022-06-01 |
Author: | Karl Gregory |
Maintainer: | Karl Gregory <[email protected]> |
Description: | Implements moving-blocks bootstrap and extended tapered-blocks bootstrap, as well as smooth versions of each, for quantile regression in time series. This package accompanies the paper: Gregory, K. B., Lahiri, S. N., & Nordman, D. J. (2018). A smooth block bootstrap for quantile regression with time series. The Annals of Statistics, 46(3), 1138-1166. |
License: | GPL-3 |
RoxygenNote: | 7.2.0 |
Imports: | quantreg |
Repository: | https://gregorkb.r-universe.dev |
RemoteUrl: | https://github.com/gregorkb/qregbb |
RemoteRef: | HEAD |
RemoteSha: | db3656c4ace07208e3f7fbad6005908f3630400f |
Index of help topics:
QregBB Implements MBB, ETBB, SMBB, and SETBB for quantile regression QregBB-package Block Bootstrap Methods for Quantile Regression in Time Series getNPPIblksizesQR Chooses block sizes for MBB, ETBB, SMBB, and SETBB via the NPPI for quantile regression
The main function is the QregBB
function, which implements the moving-blocks bootstrap (MBB), the extended tapered-blocks bootstrap (ETBB), and smooth versions of each (SMBB, SETBB). The function getNPPIblksizesQR
chooses the block size based on the non-parametric plug-in method described in Lahiri (2013). For the smooth methods, the bandwidth is chosen by using the function bw.SJ
function on the fitted residuals; then the bandwidth matrix is the identity matrix times the value returned by bw.SJ
.
Karl Gregory
Maintainer: Karl Gregory <[email protected]>
Gregory, K. B., Lahiri, S. N., & Nordman, D. J. (2018). A smooth block bootstrap for quantile regression with time series. The Annals of Statistics, 46(3), 1138-1166.
Lahiri, S. N. (2003). Resampling Methods for Dependent Data. Springer, New York.
n <- 100 X1 <- arima.sim(model=list(ar=c(.7,.1)),n) X2 <- arima.sim(model=list(ar=c(.2,.1)),n) e <- arima.sim(model=list(ar=c(.7,.1)),n) Y <- X1 + e X <- cbind(rep(1,n),X1,X2) QregBB.out <- QregBB(Y,X,tau=.5,l=4,B=500,h=NULL,alpha=0.05) QregBB.out
n <- 100 X1 <- arima.sim(model=list(ar=c(.7,.1)),n) X2 <- arima.sim(model=list(ar=c(.2,.1)),n) e <- arima.sim(model=list(ar=c(.7,.1)),n) Y <- X1 + e X <- cbind(rep(1,n),X1,X2) QregBB.out <- QregBB(Y,X,tau=.5,l=4,B=500,h=NULL,alpha=0.05) QregBB.out
Chooses block sizes for MBB, ETBB, SMBB, and SETBB via the NPPI for quantile regression
getNPPIblksizesQR(Y, X, tau, min.in.JAB = 100)
getNPPIblksizesQR(Y, X, tau, min.in.JAB = 100)
Y |
the vector of response values. |
X |
the design matrix (including a column of ones for the intercept). |
tau |
the quantile of interest. |
min.in.JAB |
the minimum number of Monte-Carlos draws desired in each jackknife draw |
This function is based on the nonparametric plug-in (NPPI) method discussed in Lahiri (2003), which makes use of the jackknife-after-bootstrap (JAB).
Returns a list of the NPPI-selected block sizes for the MBB, SMBB, ETBB, and SETBB.
Gregory, K. B., Lahiri, S. N., & Nordman, D. J. (2018). A smooth block bootstrap for quantile regression with time series. The Annals of Statistics, 46(3), 1138-1166.
Lahiri, S. N. (2003). Resampling Methods for Dependent Data. Springer, New York.
# generate some data and use NPPI to choose block sizes for MBB, SMBB, ETBB, and SETBB. n <- 50 X1 <- arima.sim(model=list(ar=c(.7,.1)),n) X2 <- arima.sim(model=list(ar=c(.2,.1)),n) e <- arima.sim(model=list(ar=c(.7,.1)),n) Y <- X1 + e X <- cbind(rep(1,n),X1,X2) blksize.out <- getNPPIblksizesQR(Y,X,tau=.5) blksize.out
# generate some data and use NPPI to choose block sizes for MBB, SMBB, ETBB, and SETBB. n <- 50 X1 <- arima.sim(model=list(ar=c(.7,.1)),n) X2 <- arima.sim(model=list(ar=c(.2,.1)),n) e <- arima.sim(model=list(ar=c(.7,.1)),n) Y <- X1 + e X <- cbind(rep(1,n),X1,X2) blksize.out <- getNPPIblksizesQR(Y,X,tau=.5) blksize.out
Implements MBB, ETBB, SMBB, and SETBB for quantile regression
QregBB(Y, X, tau, l, B = 500, h = NULL, alpha = 0.05)
QregBB(Y, X, tau, l, B = 500, h = NULL, alpha = 0.05)
Y |
the vector of response values. |
X |
the design matrix (including a column of ones for the intercept). |
tau |
the quantile of interest. |
l |
block size. |
B |
the number of Monte Carlo bootstrap samples to draw. |
h |
a scalar bandwidth (bandwidth matrix is |
alpha |
a significance level to which the returned confidence intervals will correspond. |
A list is returned containing for the MBB, SMBB, ETBB, and SETBB the set of Monte Carlo draws of the pivot quantity , confidence intervals for each component of
corresponding to the specified confidence level, and estimates of the asymptotic covariance matrix of the pivot quantity
.
#' @references
Gregory, K. B., Lahiri, S. N., & Nordman, D. J. (2018). A smooth block bootstrap for quantile regression with time series. *The Annals of Statistics*, 46(3), 1138-1166.
A 'print.QregBB' method exists which prints to the console the bootstrap standard errors for each coefficient estimator from the MBB, SMBB, ETBB, and SETBB methods as well as confidence intervals for each coefficient at the specified level.
# generate some data and perform block-bootstrap methods n <- 100 X1 <- arima.sim(model=list(ar=c(.7,.1)),n) X2 <- arima.sim(model=list(ar=c(.2,.1)),n) e <- arima.sim(model=list(ar=c(.7,.1)),n) Y <- X1 + e X <- cbind(rep(1,n),X1,X2) QregBB.out <- QregBB(Y,X,tau=.5,l=4,B=500,h=NULL,alpha=0.05) QregBB.out
# generate some data and perform block-bootstrap methods n <- 100 X1 <- arima.sim(model=list(ar=c(.7,.1)),n) X2 <- arima.sim(model=list(ar=c(.2,.1)),n) e <- arima.sim(model=list(ar=c(.7,.1)),n) Y <- X1 + e X <- cbind(rep(1,n),X1,X2) QregBB.out <- QregBB(Y,X,tau=.5,l=4,B=500,h=NULL,alpha=0.05) QregBB.out