Title: | Weighted Fused LASSO Signal Approximator ('wFLSA') |
---|---|
Description: | A package for computing the Weighted Fused LASSO Signal Approximator (wFLSA). |
Authors: | Louis Dijkstra [aut, cre] |
Maintainer: | Louis Dijkstra <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.2.1 |
Built: | 2024-11-21 12:37:30 UTC |
Source: | https://github.com/bips-hb/wflsa |
The wFLSA algorithm requires the choice of a matrix such that
is positive semidefinite.
We choose the matrix
to be diagonal with a fixed value
.
This function determines the smallest value of
such that
is indeed positive semidefinite. We do this be determining
the largest eigenvalue
calculate_diagonal_matrix_A(W, eta1, eta2)
calculate_diagonal_matrix_A(W, eta1, eta2)
W |
Weight matrix |
eta1 , eta2
|
The values |
Value of
Zhu, Y. (2017). An Augmented ADMM Algorithm With Application to the Generalized Lasso Problem. Journal of Computational and Graphical Statistics, 26(1), 195–204. https://doi.org/10.1080/10618600.2015.1114491
Solves efficiently the generalized LASSO problem of the form
where and
are
-dimensional vectors and
is a
-matrix where
.
We solve this optimization problem using an adaption of the ADMM
algorithm presented in Zhu (2017).
genlassoRcpp(Y, W, m, eta1, eta2, a, rho, max_iter, eps, truncate)
genlassoRcpp(Y, W, m, eta1, eta2, a, rho, max_iter, eps, truncate)
Y |
The |
W |
The weight matrix |
m |
The number of graphs |
eta1 |
Equals |
eta2 |
Equals |
a |
Value added to the diagonal of |
rho |
The ADMM's parameter |
max_iter |
Maximum number of iterations |
eps |
Stopping criterion. If differences
are smaller than |
truncate |
Values below |
The estimated vector
Zhu, Y. (2017). An Augmented ADMM Algorithm With Application to the Generalized Lasso Problem. Journal of Computational and Graphical Statistics, 26(1), 195–204. https://doi.org/10.1080/10618600.2015.1114491
This function prints information about the fitted wFLSA object, including the number of variables, the number of lambda pairs, and the estimated beta coefficients.
## S3 method for class 'wflsa.fit' print(x, ...)
## S3 method for class 'wflsa.fit' print(x, ...)
x |
An object of class wflsa.fit. |
... |
Additional arguments to be passed to the print function. |
Solves the weighted Fused LASSO Signal Approximator optimization problem using an ADMM-based approach. The problem is formulated as follows:
where:
is the response with mean
.
is the vector of coefficients to be estimated.
and
are the
- and
-norms, respectively.
is the regularization parameter controlling the strength of the sparsity penalty.
is the regularization parameter controlling the smoothness.
is the weight between the
-th and
-th coefficient.
wflsa( y, W, lambda1 = c(0.1), lambda2 = c(0.1), rho = 1, max_iter = 1e+05, eps = 1e-10, truncate = 1e-04, offset = TRUE )
wflsa( y, W, lambda1 = c(0.1), lambda2 = c(0.1), rho = 1, max_iter = 1e+05, eps = 1e-10, truncate = 1e-04, offset = TRUE )
y |
Vector of length |
W |
Weight matrix of dimensions |
lambda1 |
Vector of positive regularization parameters for |
lambda2 |
Vector of positive regularization parameters for smoothness penalty. |
rho |
ADMM's parameter (Default: |
max_iter |
Maximum number of iterations (Default: |
eps |
Stopping criterion. If differences are smaller than |
truncate |
Values below |
offset |
Logical indicating whether to include an intercept term (Default: |
A list containing:
betas
: Estimated vector from the Weighted Fused LASSO.
tuning_parameters
: Data frame with tuning parameters. The column df
contains the number of non-zero coefficients for the different lambda-values
all input variables.
Important Note: The algorithm assumes to be centered, i.e., its mean is 0.
# Example usage of the wflsa function y <- c(1, 2, 3) W <- matrix(c(1, 0, 0, 0, 1, 0, 0, 0, 1), ncol = 3) lambda1 <- c(0.1, 0.2) lambda2 <- c(0.1, 0.2) result <- wflsa(y, W, lambda1, lambda2)
# Example usage of the wflsa function y <- c(1, 2, 3) W <- matrix(c(1, 0, 0, 0, 1, 0, 0, 0, 1), ncol = 3) lambda1 <- c(0.1, 0.2) lambda2 <- c(0.1, 0.2) result <- wflsa(y, W, lambda1, lambda2)