| Title: | LASSO Spatial Median Regression |
|---|---|
| Description: | Penalized spatial median regression using LASSO. The iteratively reweighted least squares algorithm is used to solve the spatial median regression problem and weighted LASSO is employed. |
| Authors: | Michail Tsagris [aut, cre] |
| Maintainer: | Michail Tsagris <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.0 |
| Built: | 2026-10-12 10:11:37 UTC |
| Source: | https://github.com/cran/smrlasso |
Penalized spatial median regression using LASSO. The iteratively reweighted least squares algorithm is used to solve the spatial median regression problem and weighted LASSO is employed.
| Package: | smrlasso |
| Type: | Package |
| Version: | 1.0 |
| Date: | 2026-09-01 |
Michail Tsagris <[email protected]>.
Michail Tsagris [email protected]
Cross-validation for the LASSO spatial median regression.
cv.smrlasso(y, x, lambda = NULL, tol = 1e-06, eps = 1e-6, step_min = 1e-12, max_bt = 50, nfolds = 10, folds = NULL, seed = NULL)cv.smrlasso(y, x, lambda = NULL, tol = 1e-06, eps = 1e-6, step_min = 1e-12, max_bt = 50, nfolds = 10, folds = NULL, seed = NULL)
y |
A matrix with multivariate data. |
x |
A matrix with predictors. |
lambda |
If you have a sequence of lambda values pass it here, otherwise leave it NULL |
tol |
The tolerance value to terminate the IRLS algorithm. |
eps |
A small number to be added in the weights during the IRLS algortihm. |
step_min |
The minimum step to to modify the matrix of coefficients while performing the backtraking line search while searching. |
max_bt |
The maximum number of iterations the line search will perform. |
nfolds |
The number of folds to create. |
folds |
If you already have a list with the folds pass it here, otherwise leave it NULL. |
seed |
IF you want the same folds to be created set a seed number. |
K-fold cross-validation to choose the optimal value of lambda in the spatial median regression using LASSO is performed.
A list including:
runtime |
The runtime of the cross-validation process. |
norma |
A vector with the |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
x <- matrix(rnorm(100 * 20), 100, 20) y <- matrix(rnorm(100 * 3), 100, 3) mod <- smr.lasso(y, x)x <- matrix(rnorm(100 * 20), 100, 20) y <- matrix(rnorm(100 * 3), 100, 3) mod <- smr.lasso(y, x)
LASSO spatial median regression.
smr.lasso(y, x, lambda = NULL, tol = 1e-06, eps = 1e-6, step_min = 1e-12, max_bt = 50, xnew = NULL)smr.lasso(y, x, lambda = NULL, tol = 1e-06, eps = 1e-6, step_min = 1e-12, max_bt = 50, xnew = NULL)
y |
A matrix with multivariate data. |
x |
A matrix with predictors. |
lambda |
If you have a sequence of lambda values pass it here, otherwise leave it NULL |
tol |
The tolerance value to terminate the IRLS algorithm. |
eps |
A small number to be added in the weights during the IRLS algortihm. |
step_min |
The minimum step to to modify the matrix of coefficients while performing the backtraking line search while searching. |
max_bt |
The maximum number of iterations the line search will perform. |
xnew |
If you have new predictors for which you want to predict the response values pass it here, otherwise leave it NULL. |
The spatial median regression using LASSO is performed.
A list including:
info |
A matrix with 4 columns, the values of lambda, and then for each value of lambda,
the number of non-zero coefficients, the iterations required by the IRLS and the |
be |
A list with the estimated matrix of coefficients for each value of lambda. |
est |
A list with the predicted values for each value of lambda. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
x <- matrix(rnorm(100 * 20), 100, 20) y <- matrix(rnorm(100 * 3), 100, 3) mod <- smr.lasso(y, x)x <- matrix(rnorm(100 * 20), 100, 20) y <- matrix(rnorm(100 * 3), 100, 3) mod <- smr.lasso(y, x)