Learn R Programming

rRAP (version 1.1)

RAP: Initialization of a RAP object

Description

This function initializes and RAP object. This contains a Lasso regression model together with methods to iteratively update the regularization parameter.

Usage

RAP(X, y, r = 0.95, eps = 0.01, l0 = 0.1, Approx = FALSE)

Arguments

X
Burn in training data. Can either be a single observation (in this case a matrix with 1 row) or several. This must be a matrix.
y
Burn in response data
r
Fixed forgetting factor used to update
eps
Fixed stepsize used to update regularization parameter
l0
Initial guess for regularization parameter
Approx
Boolean indicating whether exact or approximate gradient should be calculated when updating regularization parameter.

Value

A RAP object is returned with the following elements: A RAP object is returned with the following elements:The object has the following methods: The object has the following methods:

Details

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

References

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

See Also

update.RAP, update.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(RAPobj=R, Ynew = diabetes$y[i], Xnew=matrix(diabetes$x[i,], nrow=1))
#   }
#   ## End(Not run)

Run the code above in your browser using DataLab