l2e_regression.Rd
l2e_regression
performs L2E multivariate regression via block coordinate descent
with proximal gradient for updating both beta and tau.
l2e_regression(y, X, b, tau, max_iter = 100, tol = 1e-04, Show.Time = TRUE)
y | Response vector |
---|---|
X | Design matrix |
b | Initial vector of regression coefficients |
tau | Initial precision estimate |
max_iter | Maximum number of iterations |
tol | Relative tolerance |
Show.Time | Report the computing time |
Returns a list object containing the estimates for beta (vector) and tau (scalar), the number of outer block descent iterations until convergence (scalar), and the number of inner iterations per outer iteration for updating beta and tau (vectors)
# Bank data example y <- bank$y X <- as.matrix(bank[,1:13]) X0 <- as.matrix(cbind(rep(1,length(y)), X)) tauinit <- 1/mad(y) binit <- matrix(0, 14, 1) sol <- l2e_regression(y, X0, binit, tauinit)#> user system elapsed #> 0.018 0.000 0.018r <- y - X0 %*% sol$beta ix <- which(abs(r) > 3/sol$tau) l2e_fit <- X0 %*% sol$beta plot(y, l2e_fit, ylab='Predicted values', pch=16, cex=0.8)