From 942bf791ed61b1de69262f8f2be4ccdc3da58a8c Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Thu, 2 Jan 2025 12:03:19 +0100 Subject: [PATCH] Fixed typos --- R/MADMMplasso.R | 2 +- R/admm_MADMMplasso.R | 2 +- R/tree_parms.R | 2 +- README.md | 6 +++--- man/MADMMplasso.Rd | 2 +- man/admm_MADMMplasso_cpp.Rd | 2 +- man/cv_MADMMplasso.Rd | 2 +- man/tree_parms.Rd | 2 +- src/admm_MADMMplasso.cpp | 8 ++++---- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/R/MADMMplasso.R b/R/MADMMplasso.R index 30fe09c..5db483c 100644 --- a/R/MADMMplasso.R +++ b/R/MADMMplasso.R @@ -12,7 +12,7 @@ #' @param rho the Lagrange variable for the ADMM. This value is updated during the ADMM call based on a certain condition. #' @param e.abs absolute error for the ADMM #' @param e.rel relative error for the ADMM -#' @param gg penalty term for the tree structure. This is a 2x2 matrix values in the first row representing the maximum to the minimum values for lambda_1 and the second row representing the maximum to the minimum values for lambda_2. In the current setting, we set both maximum and the minimum to be same because cross validation is not carried across the lambda_1 and lambda_2. However, setting different values will work during the model fit. +#' @param gg penalty term for the tree structure. This is a 2×2 matrix values in the first row representing the maximum to the minimum values for lambda_1 and the second row representing the maximum to the minimum values for lambda_2. In the current setting, we set both maximum and the minimum to be same because cross validation is not carried across the lambda_1 and lambda_2. However, setting different values will work during the model fit. #' @param my_lambda user specified lambda_3 values #' @param lambda_min the smallest value for lambda_3 , as a fraction of max(lambda_3), the (data derived (lammax)) entry value (i.e. the smallest value for which all coefficients are zero) #' @param max_it maximum number of iterations in loop for one lambda during the ADMM optimization diff --git a/R/admm_MADMMplasso.R b/R/admm_MADMMplasso.R index 500de8d..8cab43c 100644 --- a/R/admm_MADMMplasso.R +++ b/R/admm_MADMMplasso.R @@ -13,7 +13,7 @@ #' @param N nrow(X) #' @param svd.w singular value decomposition of W #' @param invmat A list of length ncol(y), each containing the C_d part of equation 32 in the paper -#' @param gg penalty terms for the tree structure for lambda_1 and lambda_2 for the admm call. +#' @param gg penalty terms for the tree structure for lambda_1 and lambda_2 for the ADMM call. #' @return predicted values for the ADMM part #' beta0: estimated beta_0 coefficients having a size of 1 by ncol(y) diff --git a/R/tree_parms.R b/R/tree_parms.R index e95f589..0a711b7 100644 --- a/R/tree_parms.R +++ b/R/tree_parms.R @@ -3,7 +3,7 @@ #' @param y N by D matrix of response variables #' @param h is the tree cut off #' @return A trained tree with the following components: -#' Tree: the tree matrix stored in 1's and 0's +#' Tree: the tree matrix stored in 1s and 0s #' Tw: tree weights associated with the tree matrix. Each weight corresponds to a row in the tree matrix. #' h_clust: Summary of the hclust call #' y.colnames: names of the response diff --git a/README.md b/README.md index 1d26ad2..4a0965f 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ Multi variate multi-response 'ADMM' with interaction effects combines the usual squared error loss for the mult-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 method can be powperful in situations where one assumes that; -1. certain factors influence the main covariate seperatly and aims to include these fatcors as modifying varibles to the main covariate. +The method can be powerful in situations where one assumes that; +1. certain factors influence the main covariate separately and aims to include these factors as modifying variables to the main covariate. 2. There exists some form of grouping within the responses and want to include this information. We assume that the responses form overlapping groups that follows a certain hierarchy. A typical example is when one wants to model drug response for multiple drugs and assumes that some of the drugs share certain properties in common, for example drug target and chemical compounds and aims to include this information to improve prediction and also aim to predict which drug could be suitable for which patient (given a particular disease). The various diseases under study could be the modifying variable. @@ -65,7 +65,7 @@ TT <- tree_parms(y) plot(TT$h_clust) ``` -![githubb](https://github.com/ocbe-uio/MADMMplasso/assets/85598983/1a843b46-7154-405c-8db6-cec5b7a0982d) +![github](https://github.com/ocbe-uio/MADMMplasso/assets/85598983/1a843b46-7154-405c-8db6-cec5b7a0982d) ```r gg1 <- matrix(0,2,2) diff --git a/man/MADMMplasso.Rd b/man/MADMMplasso.Rd index 10334f8..35008a9 100644 --- a/man/MADMMplasso.Rd +++ b/man/MADMMplasso.Rd @@ -63,7 +63,7 @@ Categorical variables should be coded by 0-1 dummy variables: for a k-level vari \item{pal}{Should the lapply function be applied for an alternative to parallelization.} -\item{gg}{penalty term for the tree structure. This is a 2x2 matrix values in the first row representing the maximum to the minimum values for lambda_1 and the second row representing the maximum to the minimum values for lambda_2. In the current setting, we set both maximum and the minimum to be same because cross validation is not carried across the lambda_1 and lambda_2. However, setting different values will work during the model fit.} +\item{gg}{penalty term for the tree structure. This is a 2×2 matrix values in the first row representing the maximum to the minimum values for lambda_1 and the second row representing the maximum to the minimum values for lambda_2. In the current setting, we set both maximum and the minimum to be same because cross validation is not carried across the lambda_1 and lambda_2. However, setting different values will work during the model fit.} \item{tol}{threshold for the non-zero coefficients} diff --git a/man/admm_MADMMplasso_cpp.Rd b/man/admm_MADMMplasso_cpp.Rd index d266146..eb7d351 100644 --- a/man/admm_MADMMplasso_cpp.Rd +++ b/man/admm_MADMMplasso_cpp.Rd @@ -49,7 +49,7 @@ admm_MADMMplasso_cpp( \item{Z}{n by nz matrix of modifying variables. The elements of z may represent quantitative or categorical variables, or a mixture of the two. -Categorical varables should be coded by 0-1 dummy variables: for a k-level +Categorical variables should be coded by 0-1 dummy variables: for a k-level variable, one can use either k or k-1 dummy variables.} \item{max_it}{maximum number of iterations in loop for one lambda during the ADMM optimization. This is usually included in the MADMMplasso call} diff --git a/man/cv_MADMMplasso.Rd b/man/cv_MADMMplasso.Rd index 44aa3fa..a6c752f 100644 --- a/man/cv_MADMMplasso.Rd +++ b/man/cv_MADMMplasso.Rd @@ -62,7 +62,7 @@ Categorical variables should be coded by 0-1 dummy variables: for a k-level vari \item{pal}{Should the lapply function be applied for an alternative to parallelization.} -\item{gg}{penalty term for the tree structure. This is a 2x2 matrix values in the first row representing the maximum to the minimum values for lambda_1 and the second row representing the maximum to the minimum values for lambda_2. In the current setting, we set both maximum and the minimum to be same because cross validation is not carried across the lambda_1 and lambda_2. However, setting different values will work during the model fit.} +\item{gg}{penalty term for the tree structure. This is a 2×2 matrix values in the first row representing the maximum to the minimum values for lambda_1 and the second row representing the maximum to the minimum values for lambda_2. In the current setting, we set both maximum and the minimum to be same because cross validation is not carried across the lambda_1 and lambda_2. However, setting different values will work during the model fit.} \item{TT}{The results from the hierarchical clustering of the response matrix. This should same as the parameter tree used during the MADMMplasso call.} diff --git a/man/tree_parms.Rd b/man/tree_parms.Rd index 99cf1ff..ca659d0 100644 --- a/man/tree_parms.Rd +++ b/man/tree_parms.Rd @@ -13,7 +13,7 @@ tree_parms(y = y, h = 0.7) } \value{ A trained tree with the following components: -Tree: the tree matrix stored in 1's and 0's +Tree: the tree matrix stored in 1s and 0s Tw: tree weights associated with the tree matrix. Each weight corresponds to a row in the tree matrix. h_clust: Summary of the hclust call y.colnames: names of the response diff --git a/src/admm_MADMMplasso.cpp b/src/admm_MADMMplasso.cpp index 7d752f9..5e498a7 100644 --- a/src/admm_MADMMplasso.cpp +++ b/src/admm_MADMMplasso.cpp @@ -19,10 +19,10 @@ //' @param XtY a matrix formed by multiplying the transpose of X by y. //' @param y N by D matrix of responses. The X and Z variables are centered in the function. We recommend that X and Z also be standardized before the call //' @param N nrow(X) -//' @param e_abs absolute error for the admm. This is included int the call of MADMMplasso. -//' @param e_rel relative error for the admm. This is included int the call of MADMMplasso. +//' @param e_abs absolute error for the ADMM. This is included int the call of MADMMplasso. +//' @param e_rel relative error for the ADMM. This is included int the call of MADMMplasso. //' @param alpha mixing parameter, usually obtained from the MADMMplasso call. When the goal is to include more interactions, alpha should be very small and vice versa. -//' @param lambda a vector lambda_3 values for the admm call with length ncol(y). This is usually calculated in the MADMMplasso call. In our current setting, we use the same the lambda_3 value for all responses. +//' @param lambda a vector lambda_3 values for the ADMM call with length ncol(y). This is usually calculated in the MADMMplasso call. In our current setting, we use the same the lambda_3 value for all responses. //' @param alph an overrelaxation parameter in \[1, 1.8\], usually obtained from the MADMMplasso call. //' @param svd_w_tu the transpose of the U matrix from the SVD of W_hat //' @param svd_w_tv the transpose of the V matrix from the SVD of W_hat @@ -32,7 +32,7 @@ //' The easy way to obtain this is by using the function (tree_parms) which gives a default clustering. //' However, user decide on a specific structure and then input a tree that follows such structure. //' @param my_print Should information form each ADMM iteration be printed along the way? Default TRUE. This prints the dual and primal residuals -//' @param gg penalty terms for the tree structure for lambda_1 and lambda_2 for the admm call. +//' @param gg penalty terms for the tree structure for lambda_1 and lambda_2 for the ADMM call. //' @return predicted values for the ADMM part //' @description This function fits a multi-response pliable lasso model over a path of regularization values. //' @export