admmsigma

Penalized precision matrix estimation via ADMM

https://github.com/mgallow/admmsigma

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.1%) to scientific vocabulary

Keywords

admm covariance-matrix glasso lasso precision-matrix ridge
Last synced: 9 months ago · JSON representation

Repository

Penalized precision matrix estimation via ADMM

Basic Info
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Topics
admm covariance-matrix glasso lasso precision-matrix ridge
Created over 8 years ago · Last pushed almost 8 years ago
Metadata Files
Readme

README.Rmd

---
title: "ADMMsigma"
output: github_document
  
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, tidy = TRUE)
```

[![Build Status](https://travis-ci.org/MGallow/ADMMsigma.svg?branch=master)](https://travis-ci.org/MGallow/ADMMsigma)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/ADMMsigma)](https://cran.r-project.org/package=ADMMsigma)

## Overview

`ADMMsigma` is an R package that estimates a penalized precision matrix via the alternating direction method of multipliers (ADMM) algorithm. It currently supports a general elastic-net penalty that allows for both ridge and lasso-type penalties as special cases.

A (possibly incomplete) list of functions contained in the package can be found below: * `ADMMsigma()` computes the estimated precision matrix (ridge, lasso, and elastic-net type regularization optional) * `RIDGEsigma()` computes the estimated ridge penalized precision matrix via closed-form solution * `plot.ADMMsigma()` produces a heat map or line graph for cross validation errors * `plot.RIDGEsigma()` produces a heat map or line graph for cross validation errors See package [website](https://mgallow.github.io/ADMMsigma/) or [manual](https://github.com/MGallow/ADMMsigma/blob/master/ADMMsigma.pdf). ## Installation ```{r, eval = FALSE} # The easiest way to install is from CRAN install.packages("ADMMsigma") # You can also install the development version from GitHub: # install.packages("devtools") devtools::install_github("MGallow/ADMMsigma") ``` If there are any issues/bugs, please let me know: [github](https://github.com/MGallow/ADMMsigma/issues). You can also contact me via my [website](https://mgallow.github.io/). Pull requests are welcome! ## Usage ```{r, message = FALSE} library(ADMMsigma) set.seed(1234) # generate data from a sparse oracle precision matrix # we will try to estimate this matrix from the data # first compute the oracle covariance matrix S = matrix(0.7, nrow = 5, ncol = 5) for (i in 1:5){ for (j in 1:5){ S[i, j] = S[i, j]^abs(i - j) } } # print oracle precision matrix # because its sparse, some shrinkage might be useful (Omega = round(qr.solve(S), 3)) # generate 100 x 5 data matrix with rows drawn from iid N_p(0, S) set.seed(123) Z = matrix(rnorm(100*5), nrow = 100, ncol = 5) out = eigen(S, symmetric = TRUE) S.sqrt = out$vectors %*% diag(out$values^0.5) %*% t(out$vectors) X = Z %*% S.sqrt # print sample precision matrix from the data # this is perhaps a bad estimate (its not sparse) sample = (nrow(X) - 1)/nrow(X)*cov(X) round(qr.solve(sample), 5) # now use ADMMsigma to provide estimates # elastic-net type penalty (set tolerance to 1e-8) ADMMsigma(X, tol.abs = 1e-8, tol.rel = 1e-8) # lasso penalty (default tolerance) ADMMsigma(X, alpha = 1) # elastic-net penalty (alpha = 0.5) ADMMsigma(X, alpha = 0.5) # ridge penalty ADMMsigma(X, alpha = 0) # ridge penalty (using closed-form solution) RIDGEsigma(X, lam = 10^seq(-8, 8, 0.01)) # produce CV heat map for ADMMsigma ADMM = ADMMsigma(X, lam = 10^seq(-5, 5, 0.1), alpha = seq(0, 1, 0.1)) plot(ADMM, type = "heatmap") # produce line graph for CV errors for ADMMsigma plot(ADMM, type = "line") # produce CV heat map for RIDGEsigma RIDGE = RIDGEsigma(X, lam = 10^seq(-8, 8, 0.01)) plot(RIDGE, type = "heatmap") # produce line graph for CV errors for RIDGEsigma plot(RIDGE, type = "line") ```

Owner

  • Name: Matt Galloway
  • Login: MGallow
  • Kind: user
  • Location: Twin Cities, MN
  • Company: C.H. Robinson

Data scientist @ C.H. Robinson. Previously University of Minnesota PhD.

GitHub Events

Total
Last Year

Committers

Last synced: about 3 years ago

All Time
  • Total Commits: 159
  • Total Committers: 2
  • Avg Commits per committer: 79.5
  • Development Distribution Score (DDS): 0.025
Top Committers
Name Email Commits
MGallow g****1@u****u 155
Matt Galloway M****w@u****m 4
Committer Domains (Top 20 + Academic)
umn.edu: 1

Packages

  • Total packages: 1
  • Total downloads:
    • cran 289 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
cran.r-project.org: ADMMsigma

Penalized Precision Matrix Estimation via ADMM

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 289 Last month
Rankings
Forks count: 17.8%
Stargazers count: 24.2%
Average: 29.5%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 40.2%
Maintainers (1)
Last synced: about 1 year ago

Dependencies

DESCRIPTION cran
  • Rcpp >= 0.12.10 depends
  • RcppProgress >= 0.1 depends
  • doParallel * depends
  • dplyr * imports
  • foreach * imports
  • ggplot2 * imports
  • parallel * imports
  • stats * imports
  • knitr * suggests
  • microbenchmark * suggests
  • pkgdown * suggests
  • rmarkdown * suggests
  • testthat * suggests