| Type: | Package |
| Title: | LASSO Spatial Median Regression |
| Version: | 1.0 |
| Date: | 2026-09-01 |
| Author: | Michail Tsagris [aut, cre] |
| Maintainer: | Michail Tsagris <mtsagris@uoc.gr> |
| Depends: | R (≥ 4.0) |
| Imports: | Compositional, glmnet, Rfast, stats |
| 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. |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| NeedsCompilation: | no |
| Packaged: | 2026-09-01 08:39:38 UTC; mtsag |
| Repository: | CRAN |
| Date/Publication: | 2026-09-12 08:00:02 UTC |
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.
Details
| Package: | smrlasso |
| Type: | Package |
| Version: | 1.0 |
| Date: | 2026-09-01 |
Maintainers
Michail Tsagris <mtsagris@uoc.gr>.
Author(s)
Michail Tsagris mtsagris@uoc.gr
Cross-validation for the LASSO spatial median regression
Description
Cross-validation for the LASSO spatial median regression.
Usage
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)
Arguments
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. |
Details
K-fold cross-validation to choose the optimal value of lambda in the spatial median regression using LASSO is performed.
Value
A list including:
runtime |
The runtime of the cross-validation process. |
norma |
A vector with the |
Author(s)
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
See Also
Examples
x <- matrix(rnorm(100 * 20), 100, 20)
y <- matrix(rnorm(100 * 3), 100, 3)
mod <- smr.lasso(y, x)
LASSO spatial median regression
Description
LASSO spatial median regression.
Usage
smr.lasso(y, x, lambda = NULL, tol = 1e-06, eps = 1e-6,
step_min = 1e-12, max_bt = 50, xnew = NULL)
Arguments
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. |
Details
The spatial median regression using LASSO is performed.
Value
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. |
Author(s)
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
See Also
Examples
x <- matrix(rnorm(100 * 20), 100, 20)
y <- matrix(rnorm(100 * 3), 100, 3)
mod <- smr.lasso(y, x)