Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduced calls to solve() #41

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: MADMMplasso
Title: Multi Variate Multi Response 'ADMM' with Interaction Effects
Version: 0.0.0.9016
Version: 0.0.0.9017
Authors@R:
c(
person(
Expand Down
5 changes: 3 additions & 2 deletions R/admm_MADMMplasso.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ admm_MADMMplasso <- function(beta0, theta0, beta, beta_hat, theta, rho1, X, Z, m

SVD_D <- Diagonal(x = svd.w$d)
R_svd <- (svd.w$u %*% SVD_D) / N
R_svd_inv <- solve(R_svd)

rho <- rho1
Big_beta11 <- V
Expand Down Expand Up @@ -155,8 +156,8 @@ admm_MADMMplasso <- function(beta0, theta0, beta, beta_hat, theta, rho1, X, Z, m
part_z <- DD3 %*% t(W_hat)
part_y <- DD3 %*% my_beta_jj

beta_hat_j <- solve(solve(R_svd) + (svd.w$tv) %*% part_z)
beta_hat_j <- beta_hat_j %*% ((svd.w$tv) %*% part_y)
beta_hat_j <- solve(R_svd_inv + svd.w$tv %*% part_z)
beta_hat_j <- beta_hat_j %*% (svd.w$tv %*% part_y)
beta_hat_j <- part_z %*% beta_hat_j
beta_hat_JJ <- part_y - beta_hat_j
beta_hat_JJ <- matrix(beta_hat_JJ, ncol = 1)
Expand Down
Loading