Learn R Programming

rRAP (version 1.1)

update.RAP: Update sparsity parameter and regression coefficients

Description

Update regularization parameter and the associated Lasso regression coefficients, Updates can either be mini-batch or single observations.

Usage

"update"(object, Ynew, Xnew, ...)

Arguments

object
Current RAP object
Ynew
New response. In the case of mini-batch updates a vector should be provided.
Xnew
New covariates. This should be a matrix.
...
Additional arguments

Value

A RAP objecti is returned where the regularization parameter and the estimated regression coefficients have been updated.

Details

See Monti et al 2016

References

See Monti et al, "A framework for adaptive regularization in streaming Lasso models", 2016

See Also

RAP, predict.RAP

Examples

Run this code
  # Recreate Figure 1 from 
  library(lars)
  data(diabetes)
  Data = cbind(diabetes$y, diabetes$x)
  # initialize RAP object
  R = RAP(X = matrix(diabetes$x[1,], nrow=1), y = diabetes$y[1], r = .995, eps = 0.0005, l0 = .1)
  # iteratively update:
  ## Not run: 
#   for (i in 2:nrow(Data)){
#     R = update.RAP(object=R, Ynew = diabetes$y[i], Xnew=matrix(diabetes$x[i,], nrow=1))
#   }
#   ## End(Not run)

Run the code above in your browser using DataLab