Skip to content

MADMMplasso

Multi Variate Multi Response ADMM with Interaction Effects

v1.0.1 · Oct 27, 2025 · GPL-3

Description

This system allows one to model a multi-variate, multi-response problem with interaction effects. It combines the usual squared error loss for the multi-response problem with some penalty terms to encourage responses that correlate to form groups and also allow for modeling main and interaction effects that exit within the covariates. The optimization method employed is the Alternating Direction Method of Multipliers (ADMM). The implementation is based on the methodology presented on Quachie Asenso, T., & Zucknick, M. (2023) <doi:10.48550/arXiv.2303.11155>.

Downloads

143

Last 30 days

22151st

143

Last 90 days

143

Last year

CRAN Check Status

1 ERROR
2 NOTE
11 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 ERROR
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 NOTE
r-oldrel-macos-x86_64 NOTE
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK
Check details (15 non-OK)
OK r-devel-linux-x86_64-debian-clang

*


            
OK r-devel-linux-x86_64-debian-gcc

*


            
OK r-devel-linux-x86_64-fedora-clang

*


            
OK r-devel-linux-x86_64-fedora-gcc

*


            
ERROR r-devel-macos-arm64

examples

Running examples in ‘MADMMplasso-Ex.R’ failed
The error most likely occurred in:

> ### Name: MADMMplasso
> ### Title: MADMMplasso: Multi Variate Multi Response ADMM with Interaction
> ###   Effects
> ### Aliases: MADMMplasso-package MADMMplasso
> 
> ### ** Examples
> 
> # Train the model
> # generate some data
> set.seed(1235)
> N <- 100
> p <- 50
> nz <- 4
> K <- nz
> X <- matrix(rnorm(n = N * p), nrow = N, ncol = p)
> mx <- colMeans(X)
> sx <- sqrt(apply(X, 2, var))
> X <- scale(X, mx, sx)
> X <- matrix(as.numeric(X), N, p)
> Z <- matrix(rnorm(N * nz), N, nz)
> mz <- colMeans(Z)
> sz <- sqrt(apply(Z, 2, var))
> Z <- scale(Z, mz, sz)
> beta_1 <- rep(x = 0, times = p)
> beta_2 <- rep(x = 0, times = p)
> beta_3 <- rep(x = 0, times = p)
> beta_4 <- rep(x = 0, times = p)
> beta_5 <- rep(x = 0, times = p)
> beta_6 <- rep(x = 0, times = p)
> 
> beta_1[1:5] <- c(2, 2, 2, 2, 2)
> beta_2[1:5] <- c(2, 2, 2, 2, 2)
> beta_3[6:10] <- c(2, 2, 2, -2, -2)
> beta_4[6:10] <- c(2, 2, 2, -2, -2)
> beta_5[11:15] <- c(-2, -2, -2, -2, -2)
> beta_6[11:15] <- c(-2, -2, -2, -2, -2)
> 
> Beta <- cbind(beta_1, beta_2, beta_3, beta_4, beta_5, beta_6)
> colnames(Beta) <- 1:6
> 
> theta <- array(0, c(p, K, 6))
> theta[1, 1, 1] <- 2
> theta[3, 2, 1] <- 2
> theta[4, 3, 1] <- -2
> theta[5, 4, 1] <- -2
> theta[1, 1, 2] <- 2
> theta[3, 2, 2] <- 2
> theta[4, 3, 2] <- -2
> theta[5, 4, 2] <- -2
> theta[6, 1, 3] <- 2
> theta[8, 2, 3] <- 2
> theta[9, 3, 3] <- -2
> theta[10, 4, 3] <- -2
> theta[6, 1, 4] <- 2
> theta[8, 2, 4] <- 2
> theta[9, 3, 4] <- -2
> theta[10, 4, 4] <- -2
> theta[11, 1, 5] <- 2
> theta[13, 2, 5] <- 2
> theta[14, 3, 5] <- -2
> theta[15, 4, 5] <- -2
> theta[11, 1, 6] <- 2
> theta[13, 2, 6] <- 2
> theta[14, 3, 6] <- -2
> theta[15, 4, 6] <- -2
> 
> pliable <- matrix(0, N, 6)
> for (e in 1:6) {
+   pliable[, e] <- compute_pliable(X, Z, theta[, , e])
+ }
> 
> esd <- diag(6)
> e <- MASS::mvrnorm(N, mu = rep(0, 6), Sigma = esd)
> y_train <- X %*% Beta + pliable + e
> y <- y_train
> 
> colnames(y) <- c(paste0("y", seq_len(ncol(y))))
> TT <- tree_parms(y)
> plot(TT$h_clust)
> gg1 <- matrix(0, 2, 2)
> gg1[1, ] <- c(0.02, 0.02)
> gg1[2, ] <- c(0.02, 0.02)
> 
> nlambda <- 1
> e.abs <- 1E-4
> e.rel <- 1E-2
> alpha <- 0.2
> tol <- 1E-3
> fit <- MADMMplasso(
+   X, Z, y,
+   alpha = alpha, my_lambda = matrix(rep(0.2, ncol(y)), 1),
+   lambda_min = 0.001, max_it = 1000, e.abs = e.abs, e.rel = e.rel,
+   maxgrid = nlambda, nlambda = nlambda, rho = 5, tree = TT, my_print = FALSE,
+   alph = TRUE, gg = gg1, tol = tol, cl = 2L
+ )
Error in unserialize(socklist[[n]]) : error reading from connection
Calls: MADMMplasso ... recvOneData -> recvOneData.SOCKcluster -> unserialize
Execution halted
ERROR r-devel-macos-arm64

tests

  Running ‘testthat.R’ [8s/5s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > testthat::test_check("MADMMplasso")
  Loading required package: MADMMplasso
  Saving _problems/test-issue_53-89.R
  Saving _problems/test-issue_62-74.R
  Saving _problems/test-parallel-86.R
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 102 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-issue_53.R:83:1'): (code run outside of `test_that()`) ─────────
  Error in `unserialize(socklist[[n]])`: error reading from connection
  Backtrace:
      ▆
   1. └─MADMMplasso::MADMMplasso(...) at test-issue_53.R:83:1
   2.   └─foreach(i = 1:nlambda) %dopar% ...
   3.     └─e$fun(obj, substitute(ex), parent.frame(), e$data)
   4.       └─parallel::clusterApplyLB(cl, argsList, evalWrapper)
   5.         └─parallel:::dynamicClusterApply(cl, fun, length(x), argfun)
   6.           └─parallel:::recvOneResult(cl)
   7.             ├─parallel::recvOneData(cl)
   8.             └─parallel:::recvOneData.SOCKcluster(cl)
   9.               └─base::unserialize(socklist[[n]])
  ── Error ('test-issue_62.R:68:1'): (code run outside of `test_that()`) ─────────
  Error in `unserialize(socklist[[n]])`: error reading from connection
  Backtrace:
      ▆
   1. └─MADMMplasso::MADMMplasso(...) at test-issue_62.R:68:1
   2.   └─foreach(i = 1:nlambda) %dopar% ...
   3.     └─e$fun(obj, substitute(ex), parent.frame(), e$data)
   4.       └─parallel::clusterApplyLB(cl, argsList, evalWrapper)
   5.         └─parallel:::dynamicClusterApply(cl, fun, length(x), argfun)
   6.           └─parallel:::recvOneResult(cl)
   7.             ├─parallel::recvOneData(cl)
   8.             └─parallel:::recvOneData.SOCKcluster(cl)
   9.               └─base::unserialize(socklist[[n]])
  ── Error ('test-parallel.R:78:3'): (code run outside of `test_that()`) ─────────
  Error in `unserialize(socklist[[n]])`: error reading from connection
  Backtrace:
       ▆
    1. └─MADMMplasso (local) mad_wrap(legacy = TRUE, cl = r_cl, pal = FALSE) at test-parallel.R:96:3
    2.   ├─base::suppressMessages(...) at test-parallel.R:78:3
    3.   │ └─base::withCallingHandlers(...)
    4.   └─MADMMplasso::MADMMplasso(...)
    5.     └─foreach(i = 1:nlambda) %dopar% ...
    6.       └─e$fun(obj, substitute(ex), parent.frame(), e$data)
    7.         └─parallel::clusterApplyLB(cl, argsList, evalWrapper)
    8.           └─parallel:::dynamicClusterApply(cl, fun, length(x), argfun)
    9.             └─parallel:::recvOneResult(cl)
   10.               ├─parallel::recvOneData(cl)
   11.               └─parallel:::recvOneData.SOCKcluster(cl)
   12.                 └─base::unserialize(socklist[[n]])
  
  [ FAIL 3 | WARN 0 | SKIP 0 | PASS 102 ]
  Error:
  ! Test failures.
  Warning messages:
  1: In for (i in seq_len(n)) { :
    closing unused connection 6 (<-localhost:11221)
  2: In for (i in seq_len(n)) { :
    closing unused connection 5 (<-localhost:11221)
  Execution halted
OK r-devel-windows-x86_64

*


            
NOTE r-oldrel-macos-arm64

installed package size

  installed size is  7.7Mb
  sub-directories of 1Mb or more:
    libs   7.6Mb
NOTE r-oldrel-macos-x86_64

installed package size

  installed size is  8.7Mb
  sub-directories of 1Mb or more:
    libs   8.5Mb
OK r-oldrel-windows-x86_64

*


            
OK r-patched-linux-x86_64

*


            
OK r-release-linux-x86_64

*


            
OK r-release-macos-arm64

*


            
OK r-release-macos-x86_64

*


            
OK r-release-windows-x86_64

*


            

Check History

ERROR 11 OK · 2 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Mar 9, 2026
ERROR r-devel-macos-arm64

examples

Running examples in ‘MADMMplasso-Ex.R’ failed
The error most likely occurred in:

> ### Name: MADMMplasso
> ### Title: MADMMplasso: Multi Variate Multi Response ADMM with Interaction
> ###   Effects
> ### Aliases: MADMMplasso-package MADMMplasso
> 
> ### ** Examples
> 
> # Train the model
> # generate some data
> set.seed(1235)
> N <- 100
> p <- 50
> nz <- 4
> K <- nz
> X <- matrix(rnorm(n = N * p), nrow = N, ncol = p)
> mx <- colMeans(X)
> sx <- sqrt(apply(X, 2, var))
> X <- scale(X, mx, sx)
> 
NOTE r-oldrel-macos-arm64

installed package size

  installed size is  7.7Mb
  sub-directories of 1Mb or more:
    libs   7.6Mb
NOTE r-oldrel-macos-x86_64

installed package size

  installed size is  8.7Mb
  sub-directories of 1Mb or more:
    libs   8.5Mb

Dependency Network

Dependencies Reverse dependencies Matrix MASS Rcpp RcppArmadillo foreach doParallel class spatstat.sparse MADMMplasso

Version History

new 1.0.1 Mar 9, 2026