update.RAP: Update sparsity parameter and regression coefficients

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

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

Usage

1
2
## S3 method for class 'RAP'
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

Details

See Monti et al 2016

Value

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

Note

Warning that this implementation uses the shooting algorithm (co-ordinate gradient descent) to update regression coefficients. A more efficient implementation would employ stochastic gradient descent.

Author(s)

Ricardo Pio Monti

References

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

See Also

RAP, predict.RAP

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  # 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)

rRAP documentation built on May 1, 2019, 9:30 p.m.