lsprobust
implements partitioning-based least squares point estimators for the regression function and its derivatives. It also provides robust bias-corrected (pointwise and uniform) inference, including simulation-based confidence bands. Three series methods are supported: B-splines, compact supported wavelets, and piecewise polynomials.
See Cattaneo and Farrell (2013) and Cattaneo, Farrell and Feng (2020a) for complete details.
Companion commands: lspkselect
for data-driven IMSE-optimal selection of the number of knots on rectangular partitions; lsprobust.plot
for plotting results; lsplincom
for multiple sample estimation and inference.
A detailed introduction to this command is given in Cattaneo, Farrell and Feng (2020b).
For more details, and related Stata and R packages useful for empirical analysis, visit https://sites.google.com/site/nppackages/.
lsprobust(y, x, eval = NULL, neval = NULL, method = "bs", m = NULL,
m.bc = NULL, deriv = NULL, smooth = NULL, bsmooth = NULL,
ktype = "uni", knot = NULL, nknot = NULL, same = TRUE,
bknot = NULL, bnknot = NULL, J = NULL, bc = "bc3", proj = TRUE,
kselect = "imse-dpi", vce = "hc2", level = 95, uni.method = NULL,
uni.grid = NULL, uni.ngrid = 50, uni.out = FALSE, band = FALSE,
B = 1000, subset = NULL, rotnorm = TRUE)# S3 method for lsprobust
print(x, ...)
# S3 method for lsprobust
summary(object, ...)
Estimate
A matrix containing eval (grid points), N (effective sample sizes),
tau.cl (point estimates with a basis of order m
), tau.bc (bias corrected point
estimates with a basis of order m.bc
), se.cl (standard error corresponding
to tau.cl), and se.rb (robust standard error).
k.num
A matrix containing the number of inner partitioning knots used in the main regression and bias correction for each covariate.
knot
A list of knots for point estimation.
bknot
A list of knots for bias correction.
sup.cval
Critical value for constructing confidence band.
uni.output
A list containing quantities used to implement uniform inference.
opt
A list containing options passed to the function.
Outcome variable.
Independent variable. A matrix or data frame.
Evaluation points. A matrix or data frame.
Number of quantile-spaced evaluating points.
Type of basis used for expansion. Options are "bs"
for B-splines,
"wav"
for compactly supported wavelets (Cohen, Daubechies and Vial, 1993),
and "pp"
for piecewise polynomials. Default is method="bs"
.
Order of basis used in the main regression. Default is m=2
. For B-splines,
if smooth
is specified but m
is unspecified, default is m=smooth+2
.
Order of basis used to estimate leading bias. Default is m.bc=m+1
. For B-splines,
if bsmooth
is specified but m.bc
is unspecified, default is m.bc=bsmooth+2
.
Derivative order of the regression function to be estimated. A vector object of the same
length as ncol(x)
. Default is deriv=c(0,...,0)
.
Smoothness of B-splines for point estimation. When smooth=s
, B-splines have s
-order
continuous derivatives. Default is smooth=m-2
.
Smoothness of B-splines for bias correction. Default is bsmooth=m.bc-2
.
Knot placement. Options are "uni"
for evenly-spaced knots over the
support of x
and "qua"
for quantile-spaced knots. Default is ktype="uni"
.
A list of numeric vectors giving the knot positions (including boundary knots) for each dimension
which are used in the main regression. The length of the list is equal to ncol(x)
.
If not specified, it uses the number of knots either specified by users
or computed by the companion command lspkselect
to generate the
corresponding knots according to the rule specified by ktype
.
A numeric vector of the same length as ncol(x)
. Each element corresponds to
the number of inner partitioning knots for each dimension used in the main regression.
If not specified, nknot
is computed by the companion command lspkselect
.
If TRUE
, the same knots are used for bias correction as that for the
main regression. Default is same=TRUE
.
A list of numeric vectors giving knot positions used for bias correction. If not
specified and same=FALSE
, it uses the number of knots either specified by
users or computed by the companion command lspkselect
to generate
knots according to the rule specified by ktype
.
A numeric vector of the same length as ncol(x)
. Each element corresponds
to the number of inner partitioning knots for each dimension used for bias
correction. If not specified, bnknot
is computed by the companion command lspkselect
.
A numeric vector containing resolution levels of father wavelets for each dimension.
Bias correction method. Options are "bc1"
for higher-order-basis bias correction,
"bc2"
for least squares bias correction, and "bc3"
for plug-in bias correction.
Default are "bc3"
for splines and piecewise polynomials and "bc2"
for wavelets.
If TRUE
, projection of leading approximation error onto the lower-order approximation space
is included for bias correction (splines and piecewise polynomials only). Default is
proj=TRUE
.
Method for selecting the number of inner knots used by lspkselect
. Options
are "imse-rot"
for ROT implementation of IMSE-optimal number of knots and
"imse-dpi"
for second generation of DPI implementation of IMSE-optimal number
of knots. Default is kselect="imse-dpi"
.
Procedure to compute the heteroskedasticity-consistent (HCk) variance-covariance matrix estimator with plug-in residuals. Options are
"hc0"
for unweighted residuals (HC0).
"hc1"
for HC1 weights.
"hc2"
for HC2 weights. Default.
"hc3"
for HC3 weights.
Confidence level used for confidence intervals; default is level=95
.
Method used to implement uniform inference. Options are "pl"
for
a simulation-based plug-in procedure, "wb"
for a wild bootstrap
procedure. If unspecified, neither procedure is
implemented. Default is uni.method=NULL
.
A matrix containing all grid points used to implement uniform inference. Each row correponds to the coordinates of one grid point.
A numeric vector of the same length as ncol(x)
. Each element corresponds to
the number of grid points for each dimension used to implement uniform inference.
Default is uni.ngrid=50
.
If TRUE
, the quantities used to implement uniform inference is outputted. Default is
uni.out=FALSE
.
If TRUE
, the critical value for constructing confidence band is calculated. Default
is band=FALSE
. If band=TRUE
with uni.method
unspecified,
default is uni.method="pl"
.
Number of simulated samples used to obtain the critical value for confidence bands.
Default is B=1000
.
Optional rule specifying a subset of observations to be used.
If TRUE
, ROT selection is adjusted using normal densities.
further arguments
class lsprobust
objects.
print(lsprobust)
: print
method for class "lsprobust
"
summary(lsprobust)
: summary
method for class "lsprobust
"
Matias D. Cattaneo, Princeton University, Princeton, NJ. cattaneo@princeton.edu.
Max H. Farrell, University of California, Santa Barbara, CA. maxhfarrell@ucsb.edu.
Yingjie Feng (maintainer), Tsinghua University, Beijing, China. fengyingjiepku@gmail.com.
Cattaneo, M. D., and M. H. Farrell (2013): Optimal convergence rates, Bahadur representation, and asymptotic normality of partitioning estimators. Journal of Econometrics 174(2): 127-143.
Cattaneo, M. D., M. H. Farrell, and Y. Feng (2020a): Large Sample Properties of Partitioning-Based Series Estimators. Annals of Statistics, 48(3): 1718-1741, 2020.
Cattaneo, M. D., M. H. Farrell, and Y. Feng (2020b): lspartition: Partitioning-Based Least Squares Regression. R Journal, 12(1): 172-187, 2020.
Cohen, A., I. Daubechies, and P.Vial (1993): Wavelets on the Interval and Fast Wavelet Transforms. Applied and Computational Harmonic Analysis 1(1): 54-81.
lspkselect
, lsprobust.plot
, lsplincom
x <- data.frame(runif(500), runif(500))
y <- sin(4*x[,1])+cos(x[,2])+rnorm(500)
est <- lsprobust(y, x)
summary(est)
Run the code above in your browser using DataLab