The R package FLAG
implements the methods based on the paper Flexible and Accurate Methods for Estimation and Inference of Gaussian Graphical Models with Applications.
FLAG aims to estimate precision matrix entries accurately and efficiently, and further quantify the uncertainty of each entry, which allows for better leveraging of the common structure across different groups through meta-analysis.
For a quick start, you can install the development version of FLAG
from GitHub with:
# install.packages("devtools")
devtools::install_github("YangLabHKUST/FLAG")
- This is a basic example which shows you how to solve a common problem:
library(FLAG)
rm(list = ls())
set.seed(1234)
N = 20
P = 10
pi = 0.2
Pre = matrix(sample(c(0.2, 0.4), P*P, replace = T) * rbinom(P*P, 1, pi), nrow = P, ncol = P )
Pre[lower.tri(Pre)] = t(Pre)[lower.tri(Pre)]
diag(Pre) = 1
vals <- eigen(Pre)$values
Sigma = solve(Pre)
Z = MASS::mvrnorm(N, rep(0, P), Sigma)
Z.c = scale(Z, center = T, scale = F)
results = FLAG(Z.c)
results$precision.est
library(FLAG)
For the detailed experiments, please refer to NumericalResults/RealData/GeneExpression/gene_expression_data_analysis.ipynb
library(FLAG)
For the detailed experiments, please refer to NumericalResults/RealData/TermAssociation/meta_analysis.ipynb
library(FLAG)
For the detailed experiments, please refer to NumericalResults/RealData/StockComovement/network_measure.ipynb
If you find the FLAG
package or any of the source code in this
repository useful for your work, please cite:
Qian, Y., Hu, X., & Yang, C. (2023). Flexible and Accurate Methods for Estimation and Inference of Gaussian Graphical Models with Applications. arXiv e-prints, arXiv-2306. https://doi.org/10.48550/arXiv.2306.17584
Please feel free to contact Yueqi Qian, Prof. Xianghong Hu, or Prof. Can Yang if any inquiries.