View source: R/l2e_regression_MM.R
l2e_regression_MM | R Documentation |
l2e_regression_MM
performs L2E multivariate regression via block coordinate descent
with MM for updating beta and modified Newton for updating tau.
l2e_regression_MM( y, X, beta, tau, max_iter = 100, tol = 1e-04, Show.Time = TRUE )
y |
response |
X |
Design matrix |
beta |
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 eta (vectors)
# Bank data example y <- bank$y X <- as.matrix(bank[,1:13]) X0 <- as.matrix(cbind(rep(1,length(y)), X)) tau <- 1/mad(y) b <- matrix(0, 14, 1) sol <- l2e_regression_MM(y, X0, b, tau) r <- 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) points(y[ix], l2e_fit[ix], pch=16, col='blue', cex=0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.