diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2016-02-10 22:31:02 -0500 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2016-02-10 22:31:02 -0500 |
| commit | dc4814a034040502e0ebe28f1baf22af6635b86d (patch) | |
| tree | 78a318ff4c8ada2f5bf439b431bb115221b90856 | |
| parent | added main package docs to git (diff) | |
| download | sparsestep-dc4814a034040502e0ebe28f1baf22af6635b86d.tar.gz sparsestep-dc4814a034040502e0ebe28f1baf22af6635b86d.zip | |
add docs to git
| -rw-r--r-- | man/coef.sparsestep.Rd | 29 | ||||
| -rw-r--r-- | man/path.sparsestep.Rd | 95 | ||||
| -rw-r--r-- | man/plot.sparsestep.Rd | 26 | ||||
| -rw-r--r-- | man/predict.sparsestep.Rd | 31 | ||||
| -rw-r--r-- | man/sparsestep-package.Rd | 40 |
5 files changed, 221 insertions, 0 deletions
diff --git a/man/coef.sparsestep.Rd b/man/coef.sparsestep.Rd new file mode 100644 index 0000000..578b75c --- /dev/null +++ b/man/coef.sparsestep.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/coef.sparsestep.R +\name{coef.sparsestep} +\alias{coef} +\alias{coef.sparsestep} +\title{Get the coefficients of a fitted SparseStep model} +\usage{ +\method{coef}{sparsestep}(object, ...) +} +\arguments{ +\item{object}{a \code{sparsestep} object} + +\item{\dots}{further argument are ignored} +} +\value{ +The coefficients of the SparseStep model (i.e. the betas). If the +model was fitted with an intercept this will be the first value in the +resulting vector. +} +\description{ +Returns the coefficients of the SparseStep model. +} +\examples{ +x <- matrix(rnorm(100*20), 100, 20) +y <- rnorm(100) +fit <- sparsestep(x, y) +coef(fit) +} + diff --git a/man/path.sparsestep.Rd b/man/path.sparsestep.Rd new file mode 100644 index 0000000..4d90956 --- /dev/null +++ b/man/path.sparsestep.Rd @@ -0,0 +1,95 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/path.sparsestep.R +\name{path.sparsestep} +\alias{path.sparsestep} +\title{Approximate path algorithm for the SparseStep model} +\usage{ +path.sparsestep(x, y, max.depth = 10, gamma0 = 1000, gammastop = 1e-04, + IMsteps = 2, gammastep = 2, normalize = TRUE, intercept = TRUE, + force.zero = TRUE, threshold = 1e-07, XX = NULL, Xy = NULL, + use.XX = TRUE, use.Xy = TRUE) +} +\arguments{ +\item{x}{matrix of predictors} + +\item{y}{response} + +\item{max.depth}{maximum recursion depth} + +\item{gamma0}{starting value of the gamma parameter} + +\item{gammastop}{stopping value of the gamma parameter} + +\item{IMsteps}{number of steps of the majorization algorithm to perform for +each value of gamma} + +\item{gammastep}{factor to decrease gamma with at each step} + +\item{normalize}{if TRUE, each variable is standardized to have unit L2 +norm, otherwise it is left alone.} + +\item{intercept}{if TRUE, an intercept is included in the model (and not +penalized), otherwise no intercept is included} + +\item{force.zero}{if TRUE, absolute coefficients smaller than the provided +threshold value are set to absolute zero as a post-processing step, +otherwise no thresholding is performed} + +\item{threshold}{threshold value to use for setting coefficients to +absolute zero} + +\item{XX}{The X'X matrix; useful for repeated runs where X'X stays the same} + +\item{Xy}{The X'y matrix; useful for repeated runs where X'y stays the same} + +\item{use.XX}{whether or not to compute X'X and return it} + +\item{use.Xy}{whether or not to compute X'y and return it} +} +\value{ +A "sparsestep" S3 object is returned, for which print, predict, +coef, and plot methods exist. It has the following items: +\item{call}{The call that was used to construct the model.} +\item{lambda}{The value(s) of lambda used to construct the model.} +\item{gamma0}{The gamma0 value of the model.} +\item{gammastop}{The gammastop value of the model} +\item{IMsteps}{The IMsteps value of the model} +\item{gammastep}{The gammastep value of the model} +\item{intercept}{Boolean indicating if an intercept was fitted in the +model} +\item{force.zero}{Boolean indicating if a force zero-setting was +performed.} +\item{threshold}{The threshold used for a forced zero-setting} +\item{beta}{The resulting coefficients stored in a sparse matrix format +(dgCMatrix). This matrix has dimensions nvar x nlambda} +\item{a0}{The intercept vector for each value of gamma of length nlambda} +\item{normx}{Vector used to normalize the columns of x} +\item{meanx}{Vector of column means of x} +\item{XX}{The matrix X'X if use.XX was set to TRUE} +\item{Xy}{The matrix X'y if use.Xy was set to TRUE} +} +\description{ +Fits the entire regularization path for SparseStep using a +Golden Section search. Note that this algorithm is approximate, there is no +guarantee that the solutions _between_ induced values of lambdas do not +differ from those calculated. For instance, if solutions are calculated at +\eqn{\lambda_{i}}{\lambda[i]} and \eqn{\lambda_{i+1}}{\lambda[i+1]}, this +algorithm ensures that \eqn{\lambda_{i+1}}{\lambda[i+1]} has one more zero +than the solution at \eqn{\lambda_{i}}{\lambda[i]} (provided the recursion +depth is large enough). There is however no guarantee that there are no +different solutions between \eqn{\lambda_{i}}{\lambda[i]} and +\eqn{\lambda_{i+1}}{\lambda[i+1]}. This is an ongoing research topic. + +Note that this path algorithm is not faster than running the +\code{sparsestep} function with the same \eqn{\lambda} sequence. +} +\examples{ +x <- matrix(rnorm(100*20), 100, 20) +y <- rnorm(100) +pth <- path.sparsestep(x, y) +} +\seealso{ +\code{\link{coef}}, \code{\link{print}}, \code{\link{predict}}, +\code{\link{plot}}, and \code{\link{sparsestep}}. +} + diff --git a/man/plot.sparsestep.Rd b/man/plot.sparsestep.Rd new file mode 100644 index 0000000..739906d --- /dev/null +++ b/man/plot.sparsestep.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/plot.sparsestep.R +\name{plot.sparsestep} +\alias{plot} +\alias{plot.sparsestep} +\title{Plot the SparseStep path} +\usage{ +\method{plot}{sparsestep}(x, ...) +} +\arguments{ +\item{x}{a \code{sparsestep} object} + +\item{\dots}{further argument to matplot} +} +\description{ +Plot the coefficients of the SparseStep path +} +\examples{ +x <- matrix(rnorm(100*20), 100, 20) +y <- rnorm(100) +fit <- sparsestep(x, y) +plot(fit) +pth <- path.sparsestep(x, y) +plot(pth) +} + diff --git a/man/predict.sparsestep.Rd b/man/predict.sparsestep.Rd new file mode 100644 index 0000000..74abfaf --- /dev/null +++ b/man/predict.sparsestep.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/predict.sparsestep.R +\name{predict.sparsestep} +\alias{predict} +\alias{predict.sparsestep} +\title{Make predictions from a SparseStep model} +\usage{ +\method{predict}{sparsestep}(object, newx, ...) +} +\arguments{ +\item{object}{Fitted \code{sparsestep} object} + +\item{newx}{Matrix of new values for \code{x} at which predictions are to +be made.} + +\item{\dots}{further argument are ignored} +} +\value{ +a matrix of numerical predictions of size nobs x nlambda +} +\description{ +Predicts the outcome variable for the SparseStep model for +each value of lambda supplied to the model. +} +\examples{ +x <- matrix(rnorm(100*20), 100, 20) +y <- rnorm(100) +fit <- sparsestep(x, y) +yhat <- predict(fit, x) +} + diff --git a/man/sparsestep-package.Rd b/man/sparsestep-package.Rd new file mode 100644 index 0000000..308d915 --- /dev/null +++ b/man/sparsestep-package.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2 (4.1.1): do not edit by hand +% Please edit documentation in R/sparsestep-package.R +\docType{package} +\name{sparsestep-package} +\alias{sparsestep-package} +\title{SparseStep: Approximating the Counting Norm for Sparse Regularization} +\description{ +In the SparseStep regression model the ordinary least-squares problem is +augmented with an approximation of the exact \eqn{\ell_0}{l[0]} pseudonorm. +This approximation is made increasingly more accurate in the SparseStep +algorithm, resulting in a sparse solution to the regression problem. See +the references for more information. +} +\section{SparseStep functions}{ + +The main SparseStep functions are: +\describe{ +\item{\code{\link{sparsestep}}}{Fit a SparseStep model for a given range of +\eqn{\lambda} values} +\item{\code{\link{path.sparsestep}}}{Fit the SparseStep model along a path +of \eqn{\lambda} values which are generated such that a model is created at +each possible level of sparsity, or until a given recursion depth is +reached.} +} + +Other available functions are: +\describe{ +\item{\code{\link{plot}}}{Plot the coefficient path of the SparseStep +model.} +\item{\code{\link{predict}}}{Predict the outcome of the linear model using +SparseStep} +\item{\code{\link{coef}}}{Get the coefficients from the SparseStep model} +\item{\code{\link{print}}}{Print a short description of the SparseStep +model} +} +} +\author{ +Gertjan van den Burg (author and maintainer). +} + |
