Commit df664b31 authored by Tom Reynkens's avatar Tom Reynkens

Add details on input for .PO and C++ functions

parent ee7166e6
Type: Package
Package: smurf
Title: Sparse Multi-Type Regularized Feature Modeling
Version: 0.3.0
Date: 2018-09-17
Version: 0.3.0.9000
Date: 2018-09-18
Authors@R: c(
person("Sander", "Devriendt", role = "aut"),
person("Tom", "Reynkens", email = "tomreynkens@hotmail.com", role = c("aut", "cre"),
......
......@@ -15,8 +15,8 @@
# pen.mat.cov: List with (weighted) penalty matrix per predictor
# pen.mat.cov.aux: List with eigenvector matrix and eigenvalue vector of (weighted) penalty matrix per predictor
# lambda: Penalty parameter
# lambda1: The penalty parameter for the L_1-penalty in Sparse (Generalized) Fused Lasso or Sparse Graph-Guided Fused Lasso is lambda*lambda1
# lambda2: The penalty parameter for the L_2-penalty in Group (Generalized) Fused Lasso or Group Graph-Guided Fused Lasso is lambda*lambda2
# lambda1: List with lambda1 multiplied with penalty weights (for Lasso penalty) per predictor. The penalty parameter for the L_1-penalty in Sparse (Generalized) Fused Lasso or Sparse Graph-Guided Fused Lasso is lambda*lambda1
# lambda2: List with lambda2 multiplied with penalty weights (for Group Lasso penalty) per predictor. The penalty parameter for the L_2-penalty in Group (Generalized) Fused Lasso or Group Graph-Guided Fused Lasso is lambda*lambda2
# step: Current step size
# po.ncores: Number of cores used when computing the proximal operators
.PO <- function(beta.tilde, beta.old, pen.cov, n.par.cov, group.cov, pen.mat.cov, pen.mat.cov.aux,
......
......@@ -2,7 +2,7 @@
using namespace Rcpp;
using namespace arma;
// Soft thresholding operator S_y(x)
// Soft thresholding operator S_y(x) where x is a vector
arma::vec soft_thresh(const arma::vec& x, const double y) {
arma::vec z = zeros(x.n_elem);
......@@ -14,7 +14,7 @@ arma::vec soft_thresh(const arma::vec& x, const double y) {
return z;
}
// Soft thresholding operator S_y(x) where y is a vector
// Soft thresholding operator S_y(x) where both x and y are vectors
arma::vec soft_thresh_vec(const arma::vec& x, const arma::vec& y) {
arma::vec z = zeros(x.n_elem);
......@@ -25,7 +25,7 @@ arma::vec soft_thresh_vec(const arma::vec& x, const arma::vec& y) {
return z;
}
// Group soft thresholding operator S_y(x)
// Group soft thresholding operator S_y(x) where x is a vector
arma::vec group_soft_thresh(const arma::vec& x, const double y) {
double norm_x = norm(x, 2);
......@@ -41,8 +41,21 @@ arma::vec group_soft_thresh(const arma::vec& x, const double y) {
return z;
}
// Implementation of ADMM algorithm to compute proximal operator for Fused Lasso, Generalized Fused Lasso,
// 2D Fused Lasso and Graph-Guided Fused Lasso
//
// beta_tilde: Vector of coefficients after gradient update
// slambda: Penalty parameter (lambda) multiplied with step size (s)
// lambda1: Vector with lambda1 multiplied with penalty weights (for Lasso). The penalty parameter for the L_1-penalty in Sparse (Generalized) Fused Lasso or Sparse Graph-Guided Fused Lasso is lambda*lambda1
// lambda2: lambda2 multiplied with penalty weight (for Group Lasso). The penalty parameter for the L_2-penalty in Group (Generalized) Fused Lasso or Group Graph-Guided Fused Lasso is lambda*lambda2
// penmat: (Weighted) Penalty matrix
// Q: Matrix with eigenvectors of (weighted) penalty matrix in the columns
// eigval: Vector with eigenvalues of (weighted) penalty matrix
// fast: Boolean indicating if the fast version to compute inverses, in the ADMM update of x, is used
// maxiter: Maximum number of iterations
// rho: Initial value for augmented Lagrangian parameter
// beta_old: Vector with previous coefficient estimates
// [[Rcpp::export]]
arma::vec admm_po_cpp(const arma::vec& beta_tilde, const double slambda, const arma::vec& lambda1, const double lambda2,
const arma::mat& penmat, const arma::mat& Q, const arma::vec& eigval, const bool fast,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment