Skip to content

Tanya-Garcia-Lab/mgcov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mgcov: maximum likelihood estimation of Gaussian covariance matrices

The R package mgcov performs maximum likelihood estimation of a sparse covariance matrix for Gaussian distribution using thresholding and banding.

Relevant references can be found at:

Installation

devtools::install_github("rakheon/mgcov", force = TRUE)

Example

library(mgcov)
library(mvtnorm)

# data generation
p <-10; n<- 100
Sigma = diag(p); diag(Sigma[-p,-1])=0.5; diag(Sigma[-1,-p])=0.5
dat <- rmvnorm(n,mean=rep(0,ncol(Sigma)),sigma=Sigma)

# COMET (univeral thresholding) by AIC and BIC
res_uni = COmet(dat, lambda = seq(0,1,0.01))
res_uni$cov_list[[which.min(res_uni$aic)]]; res_uni$cov_list[[which.min(res_uni$bic)]]

# COMET (adaptive thresholding) by AIC and BIC
res_ada = COmet(dat, mul = 3)
res_ada$cov_list[[which.min(res_ada$aic)]]; res_ada$cov_list[[which.min(res_ada$bic)]]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages