rq.fit.sfnc {nprq} | R Documentation |
Fit constrained regression quantiles using a sparse implementation of the Frisch-Newton Interior-point algorithm.
rq.fit.sfnc(x, y, R, r, tau, rhs = (1-tau)*c(t(a) nsubmax, tmpmax, nnzlmax, cachsz = 64, small = 1e-08, maxiter = 100, warn.mesg = T, ...)
x |
structure of the design matrix X stored in csr format |
y |
response vector |
R |
constraint matrix stored in csr format |
r |
right-hand-side of the constraint |
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 |
... |
additional arguments |
This is a sparse implementation of the Frisch-Newton algorithm for
constrained quantile regression described in Koenker and Portnoy (1996).
The sparse matrix
linear algebra is implemented through the functions available in the R packages
SparseM
.
coef |
Regression quantile coefficients |
ierr |
Error code for the internal Fortran routine srqfn :
|
it |
Iteration count |
time |
Amount of time used in the computation |
Pin Ng
Koenker, R and Ng, P. (2002). SparseM: A Sparse Matrix Package for R,
http://www.econ.uiuc.edu/~roger/research
rq.fit.sfn
for the unconstrained version,
SparseM
for a sparse matrix package for R
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) R=rbind(diag(p+1),-diag(p+1)) r=c(rep(0,p+1),-rep(1,p+1)) rq.o=rq.fit.sfnc(as.matrix.csr(X),y,as.matrix.csr(R),r,tmpmax=floor(1e5+exp(-12.1)*(as.matrix.csr(X)@ia[p+1]-1)^2.35))