Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zosiadziedzic committed Jun 16, 2020
2 parents 36d730d + 4c5e1dc commit 2b1be17
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 33 deletions.
2 changes: 2 additions & 0 deletions gslope/NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Generated by roxygen2: do not edit by hand

S3method(coef,gslope)
S3method(graph_plot,gslope)
S3method(plot,gslope)
S3method(summary,gslope)
export(ADMM_algorithm)
export(coef)
Expand Down
14 changes: 8 additions & 6 deletions gslope/R/admm_algorithm.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ prox_matrix = function(matrix_in, lambda) {
#' @description Executes ADMM algorithm to find precision matrix.
#' @param sample_cov variance-covariance matrix.
#' @param lambda vector of SLOPE regularizers.
#' @param mu correction for scaling lambda.
#' @param mu correction for lambda scaling.
#' @param max_iter maximum number of iterations of ADMM algorithm. Default 10 000.
#' @param epsilon a value determining stop condition.
#' @keywords TODO: keywords
#' @return \code{ADMM_algorithm} A list with components:
#' \item{precision_matrix}{precision matrix revealing graph structure for the data.}
#' \item{iterations}{number of iterations before stop condition or \code{max_iter}.}
#' @details #TODO: details
#' @keywords admm
#' @return \code{ADMM_algorithm} returns a list with components:
#' \itemize{
#' \item \code{precision_matrix} precision matrix revealing graph structure for the data.
#' \item \code{iterations} number of iterations before stop condition or \code{max_iter}.
#' }
#' @details ADMM algorithm is used to solve convex optimization problems by dividing them into smaller, easier to solve problems.
#' @examples
#' sample_cov = cov(scale(mtcars))
#' lambda = gslope::create_lambda(sample_cov, nrow(mtcars))
Expand Down
2 changes: 1 addition & 1 deletion gslope/R/create_lambda.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @keywords lambda, graphical slope, penalty
#' @return \code{create_lambda()} returns a vector of the length \eqn{p * (p-1)/2}, which is equal
#' to number of elements in lower (upper) triangle of a variance-covariance matrix excluding diagonal.
#' @details The Lambda series are computed based on Benjamini-Hochberg's correction.
#' @details The Lambda series are computed based on Benjamini-Hochberg's procedure.
#' @examples
#' sample_cov = cov(scale(mtcars))
#' create_lambda(sample_cov, nrow(mtcars))
Expand Down
14 changes: 12 additions & 2 deletions gslope/R/summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
#'
#' @param x an object of class `'gslope'`
#'
#' @return Prints output on the screen
#' @return Prints following output on the screen:
#' \itemize{
#'
#' \item \code{call} formula used in function call.
#' \item \code{precision matrix} a sparse precision matrix
#' \item \code{covariance matrix} covariance matrix for the data
#' \item \code{scaled precision matrix} see: ?gslope
#' \item \code{lambda} lambda regularizers used
#' \item \code{iterations} number of iterations
#' \item \code{graph} a graph object from igraph package. For more details see ?igraph.
#' \item \code{clusters} clusters revealing sub-graph structure in the model For more details see ?gslope.
#' }
#' @examples
#' d = gslope(as.matrix(mtcars))
#' summary(d)
#'
#'
#' @export
summary <- function(x){
UseMethod("summary")
Expand Down
15 changes: 8 additions & 7 deletions gslope/man/ADMM_algorithm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gslope/man/create_lambda.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion gslope/man/graph_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 16 additions & 11 deletions gslope/man/gslope.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions gslope/man/plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions gslope/man/summary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b1be17

Please sign in to comment.