sparsity.rqt: Sparsity Estimation

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

This function estimates the density and sparsity functions of the residuals from a rq or a rqt object.

Usage

1
2
3
4
5
6
7
sparsity(object, se = "nid", hs = TRUE)
## S3 method for class 'rq'
sparsity(object, se = "nid", hs = TRUE)
## S3 method for class 'rqs'
sparsity(object, se = "nid", hs = TRUE)
## S3 method for class 'rqt'
sparsity(object, se = "nid", hs = TRUE)

Arguments

object

a rq, rqs or rqt object.

se

"iid" if errors are assumed independent and identically distributed; "nid" (default) if independent but not identically distributed; "ker" which uses a kernel estimate of the sandwich as proposed by Powell (1991).

hs

logical flag. If TRUE (default) the Hall-Sheather rule is used. Otherwise, the Bofinger's rule is used.

Details

This function is based on the code from quantreg::summary.rq and quantreg::bandwidth.rq to estimate the sparsity function for linear quantile regression models (Koenker and Bassett, 1978) and transformation models of Geraci and Jones (2014).

Value

sparsity returns an object of class list that contains three elements:

density

estimate of the density of the residuals.

sparsity

estimate of the sparsity of the residuals.

bandwidth

bandwidth used for estimation.

Author(s)

Marco Geraci

References

Geraci M and Jones MC. Improved transformation-based quantile regression. Canadian Journal of Statistics 2015;43(1):118-132.

Koenker R (2013). quantreg: Quantile Regression. R package version 5.05. URL http://CRAN.R-project.org/package=quantreg.

Koenker R, Bassett G. Regression quantiles. Econometrica. 1978;46(1):33-50.

Powell JL. Estimation of monotonic regression models under quantile restrictions. In: Barnett W, Powell J, Tauchen G, editors. Nonparametric and Semiparametric Methods in Econometrics and Statistics: Proceedings of the Fifth International Symposium on Economic Theory and Econometrics. New York, NY: Cambridge University Press 1991. p. 357-84.

See Also

rq

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(trees)

# 'rqt' object

## Not run: 
fit.rqt <- tsrq(Volume ~ Height, tsf = "bc", symm = FALSE, data = trees,
	lambda = seq(-10, 10, by = 0.01), tau = 0.5)
sparsity(fit.rqt)

## End(Not run)

# 'rq' object

## Not run: 
fit.rq <- rq(Volume ~ Height, data = trees)
sparsity(fit.rq, se = "iid")
sparsity(fit.rq, se = "nid")
sparsity(fit.rq, se = "ker")

## End(Not run)

Qtools documentation built on May 2, 2019, 6:09 p.m.