View source: R/regression_ranklassopath.R
ranklassopath | R Documentation |
ranklassopath computes the rank LAD-Lasso regularization path (over grid of penalty parameter values). Uses IRWLS algorithm.
ranklassopath(y, X, L = 120, eps = 0.001, reltol = 1e-07, printitn = F)
y: |
Numeric data vector of size N (output, respones) |
X: |
Numeric data matrix of size N x p. Each row represents one observation, and each column represents one predictor (feature). |
L: |
Positive integer, the number of lambda values on the grid to be used. The default is L=120. |
eps: |
Positive scalar, the ratio of the smallest to the largest Lambda value in the grid. Default is eps = 10^-3. |
reltol: |
Convergence threshold for IRWLS. Terminate when successive estimates differ in L2 norm by a rel. amount less than reltol. |
printitn: |
print iteration number (default = F, no printing) |
B: Fitted RLAD-Lasso regression coefficients, a p-by-(L+1) matrix, where p is the number of predictors (columns) in X, and L is the number of Lambda values.
B0: estimates values of intercepts
stats: structure with following fields: Lambda = lambda parameters in ascending order GMeAD = Mean Absolute Deviation (MeAD) of the residuals gBIC = generalized Bayesian information criterion (gBIC) value for each lambda parameter on the grid.
File location : regression_ranklassopath.R
data('prostate') X <- prostate$X y <- c(prostate$y) namess <- unlist(prostate$names) n <- nrow(X) p <- ncol(X) Xone <- cbind(rep(1,n), X) LSE <- qr.solve(Xone, y) # Least squares estimate GRlen <- 120 yout <- y yout[1] <- yout[1] + 55 ranklassopath(yout, X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.