Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision a6e1bd2af35197fecce13a4682ed3be2f1acc6a1 authored by Roger Koenker on 16 August 2015, 00:00:00 UTC, committed by Gabor Csardi on 16 August 2015, 00:00:00 UTC
version 5.18
1 parent 8361897
  • Files
  • Changes
  • d2274b7
  • /
  • man
  • /
  • rq.fit.sfnc.Rd
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:a6e1bd2af35197fecce13a4682ed3be2f1acc6a1
directory badge
swh:1:dir:5c347e8c27066c57b5a5ba25abf248cdc5c3f903
content badge
swh:1:cnt:0926a7c909f80af257724dcbf17ef8809a942c9b

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
rq.fit.sfnc.Rd
\name{rq.fit.sfnc}
\alias{rq.fit.sfnc}
\title{Sparse Constrained Regression Quantile Fitting}
\description{
  Fit constrained regression quantiles using a sparse implementation of
  the Frisch-Newton Interior-point algorithm.
}
\usage{
rq.fit.sfnc(x, y, R, r, tau = 0.5,
            rhs = (1-tau)*c(t(x) \%*\% rep(1,length(y))),control)
}
\arguments{
  \item{x}{structure of the design matrix X stored in csr format}
  \item{y}{response vector}
  \item{R}{constraint matrix stored in csr format}
  \item{r}{right-hand-side of the constraint}
  \item{tau}{desired quantile}
  \item{rhs}{the right-hand-side of the dual problem; regular users
    shouldn't need to specify this.}
  \item{control}{control paramters for fitting see \code{sfn.control}}
}
\details{
  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 package \pkg{SparseM}.
}
\value{
  \item{coef}{Regression quantile coefficients}
  \item{ierr}{Error code for the internal Fortran routine \code{srqfn}:
    \describe{
      \item{1:}{ insufficient work space in call to \code{extract}}
      \item{3:}{ insufficient storage in iwork when calling ordmmd}
      \item{4:}{ insufficient storage in iwork when calling sfinit}
      \item{5:}{ nnzl > nnzlmax when calling sfinit}
      \item{6:}{ nsub > nsubmax when calling sfinit}
      \item{7:}{ insufficient work space in iwork when calling symfct}
      \item{8:}{ inconsistancy in input when calling symfct}
      \item{9:}{ tmpsiz > tmpmax when calling symfct; increase tmpmax}
      \item{10:}{ nonpositive diagonal encountered when calling blkfct}
      \item{11:}{ insufficient work storage in tmpvec when calling blkfct}
      \item{12:}{ insufficient work storage in iwork when calling blkfct}
      \item{13:}{ nnzd > nnzdmax in e,je when calling amub}
      \item{14:}{ nnzd > nnzdmax in g,jg when calling amub}
      \item{15:}{ nnzd > nnzdmax in h,jh when calling aplb}
      \item{15:}{ tiny diagonals replaced with Inf when calling blkfct}
    }
  }
  \item{it}{Iteration count}
  \item{time}{Amount of time used in the computation}
}
\references{
  Koenker, R and Ng, P. (2002).
  SparseM:  A Sparse Matrix Package for \R; \cr
  \url{http://www.econ.uiuc.edu/~roger/research}

  Koenker, R. and P. Ng(2005).
  Inequality Constrained Quantile Regression, \emph{Sankya}, 418-440.

}
\author{Pin Ng}
\seealso{
  \code{\link{rq.fit.sfn}} for the unconstrained version,
  \pkg{SparseM} for the underlying sparse matrix \R package.
}
\examples{
## An artificial example :
n <- 200
p <- 50
set.seed(17)
X <- rnorm(n*p)
X[abs(X) < 2.0] <- 0
X <- cbind(1,matrix(X,n,p))
y <- 0.5 * apply(X,1,sum) + rnorm(n) ## true beta = (0.5, 0.5, ...)
R <- rbind(diag(p+1), -diag(p+1))
r <- c(rep( 0, p+1), rep(-1, p+1))

sX <- as.matrix.csr(X)
sR <- as.matrix.csr(R)
try(rq.o <- rq.fit.sfnc(sX, y, sR, r)) #-> not enough tmp memory

(tmpmax <- floor(1e5 + exp(-12.1)*(sX@ia[p+1]-1)^2.35))
## now ok:
rq.o <- rq.fit.sfnc(sX, y, sR, r, control = list(tmpmax = tmpmax))
}
\keyword{regression}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API