MyNixOS website logo
Description

Graphical Independence Filtering.

Provides a method of recovering the precision matrix for Gaussian graphical models efficiently. Our approach could be divided into three categories. First of all, we use Hard Graphical Thresholding for best subset selection problem of Gaussian graphical model, and the core concept of this method was proposed by Luo et al. (2014) <arXiv:1407.7819>. Secondly, a closed form solution for graphical lasso under acyclic graph structure is implemented in our package (Fattahi and Sojoudi (2019) <https://jmlr.org/papers/v20/17-501.html>). Furthermore, we implement block coordinate descent algorithm to efficiently solve the covariance selection problem (Dempster (1972) <doi:10.2307/2528966>). Our package is computationally efficient and can solve ultra-high-dimensional problems, e.g. p > 10,000, in a few minutes.

Graphical Independence Filtering

Introduction

One of the fundamental problems in data mining and statistical analysis is to detect the relationships among a set of variables. To this end, researchers apply undirected graphical models in work, which combine graph theory and probability theory to create networks that model complex probabilistic relationships. By estimating the underlying graphical model, one can capture the direct dependence between variables. In the last few decades, undirected graphical models have attracted numerous attention in various areas such as genetics, neuroscience, finance and social science.

When the data is multivariate Gaussian distributed, detecting the graphical model is equivalent to estimating the inverse covariance matrix. gif package provides efficient solutions for this problem. The core functions in gif package are hgt and sgt.

These functions based on graphical independence filtering have several advantages:

  • It's applicable to high-dimensional multivariate data and is comparable to or better than the state-of-the-art methods in respect to both graph structure recovery and parameter estimation.

  • The program is very efficient and can provide solutions for problem with over 10,000 variables in less than one minute. The following table shows the time comparison of gif functions and other efficient approaches.

Method(p = 1000)(p = 4000)(p = 10000)
hgt0.395s6.668s46.993s
sgt0.225s3.099s21.454s
QUIC1.580s117.041s1945.648s
fastclime62.704s******
  • It has comparable performance when dealing with continuous data under various distributions though it was designed for multivariate Gaussian distribution.

Particularly, hgt provides a solution for best subset selection problem in Gaussian graphical models and sgt offers closed-form solution equivalent to graphical lasso when the graph structure is acyclic.

Installation

CRAN Version

To install the gif R package from CRAN, just run:

install.packages("gif")

Github Version

To install the development version from Github, run:

library(devtools)
install_github("Mamba413/gif/R-package", build_vignettes = TRUE)

Windows user will need to install Rtools first.

Usage

Take a synthetic dataset as a simple example to illustrate how to use hgt and sgt to estimate the underlying graphical model.

Simulated Data

We extract 200 samples from the graphical model with (p = 100) and whose graph structure is the so-called AR(1). A sketch of the example could be seen in the following picture.

hgt

Users estimate the underlying (K)-sparse graph model via Hard Graphical Thresholding algorithm when a specific model size (K) is given. The hgt function would return a (p \times p) matrix with number of non-zero off-diagonal entries in the upper-triangular part equal to (K) and a (K \times 2) matrix marks down the corresponding active entries.

data("ar1")
res <- hgt(ar1[["x"]], size = 99)

sgt

For Soft Graphpical Thresholding algorithm, users could estimate the underlying model with given regularization parameter (\lambda). In the return, we not only provide the parameter matrix and the corresponding active entries mentioned above, but also a boolean flag indicating whether the estimated graph structure is acyclic, since the solution would be equivalent to graphical lasso if the graph is acyclic.

res <- sgt(ar1[["x"]], lambda = 0.01)

License

GPL (>= 2)

Reference

Metadata

Version

0.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows