rq.fit.sfn {quantreg}R Documentation

Sparse Regression Quantile Fitting

Description

Fit a quantile regression model using a sparse implementation of the Frisch-Newton interior-point algorithm.

Usage

rq.fit.sfn(a, y, tau = 0.5, rhs = (1-tau)*c(t(a) %*% rep(1,length(y))), 
   nsubmax, tmpmax, nnzlmax, cachsz = 64, small = 1e-06, maxiter = 100, warn.mesg = TRUE, ...)

Arguments

a structure of the design matrix X stored in csr format
y response vector
tau desired quantile
rhs the right-hand-side of the dual problem; regular users shouldn't need to specify this
nsubmax upper bound of the dimension of lindx in Cholesky factorization;computed automatically inside the routine if missing
tmpmax upper bound of the working array in Cholesky factorization;computed automatically inside the routine if missing
nnzlmax upper bound of the non-zero entries in the Cholesky factor L;computed automatically inside the routine if missing
cachsz size of the cache on the machine; default to 64
small convergence tolerance for the interior algorithm
maxiter upper limit for the number of iterations
warn.mesg flag for printing of warning message; default to TRUE
... optional arguments

Details

This is a sparse implementation of the Frisch-Newton algorithm for quantile regression described in Koenker and Portnoy (1996). The sparse matrix linear algebra is implemented through the functions available in the R packages SparseM.

Value

coef Regression quantile coefficients
ierr Error code for the internal Fortran routine srqfnc:
1:
insufficient work space in call to extrac t
2:
nnzd > nnzdmax
3:
insufficient storage in iwork when calling ordmmd
4:
insufficient storage in iwork when calling sfinit
5:
nnzl > nnzlmax when calling sfinit
6:
nsub > nsubmax when calling sfinit
7:
insufficient work space in iwork when calling symfct
8:
inconsistancy in input when calling symfct
9:
tmpsiz > tmpmax when calling bfinit; increase tmpmax
10:
nonpositive diagonal encountered, not positive definite
11:
insufficient work storage in tmpvec when calling blkfct
12:
insufficient work storage in iwork when calling blkfct
it Iteration count
time Amount of time used in the computation

Author(s)

Pin Ng

References

Koenker, R and Ng, P. (2002). SparseM: A Sparse Matrix Package for R,
http://www.econ.uiuc.edu/~roger/research

See Also

rq.fit.sfnc for the constrained version, SparseM for a sparse matrix package for R

Examples

n=200
p=50
X=rnorm(n*p)
X[abs(X)<2.0]=0
X=cbind(1,matrix(X,n,p))
y=.5*apply(X,1,sum)+rnorm(n)
rq.o=rq.fit.sfn(as.matrix.csr(X),y,tmpmax=floor(1e5+exp(-12.1)*(as.matrix.csr(X)@ia[p+1]-1)^2.35))

[Package quantreg version 3.82 Index]