Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Monte Carlo Penalty Selection for graphical lasso

License

NotificationsYou must be signed in to change notification settings

markkukuismin/MCPeSe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub

MCPeSe

Monte Carlo Penalty Selection (MCPeSe) for graphical lasso.

Example

library(huge)source("mcpese.R")########################################################### Initialize seed number:#seed = Sys.time()#seed = as.integer(seed)#seed = seed %% 100000seed=59040set.seed(seed)########################################################### Graphical model simulation:p=200n=210Model="hub"HugeData= huge.generator(n=n,d=p,graph=Model)nlambda=100########################################################### Compute Glasso solution path:L= huge(HugeData$data,nlambda=nlambda,method="glasso")########################################################### Run the A-R selection (uniform prior),ARSelect= mcpese(L,n=n,M=1000)names(ARSelect)rhos=ARSelect$rhosARSelect$accept.rate########################################################### Run the M-H selection (uniform prior),MHSelect= mcpese(L,n=n,nSteps=1000,method="M-H")names(MHSelect)rhos=MHSelect$rhosMHSelect$accept.rateplot(rhos,type="l")##########################################################

MHMCMCSample

# Either use the mean of rho values...mean(rhos)#ThetaARSelect = huge(Y, lambda=mean(rhos), method="glasso")#ThetaAR = as.matrix(ThetaARSelect$icov[[1]])# ... or pick the smallest tuning parameter value from the solution path# which is larger or equal to the mean value:optARrhoIndx=ARSelect$opt.index# This is sup{i : rho[i] >= mean(rhos)}optMHrhoIndx=MHSelect$opt.indexhuge.plot(HugeData$theta)title("Ground truth")##########################################################

GroundTruthGraph

huge.plot(L$path[[optARrhoIndx]])title("Accept-Reject sampling")##########################################################

ARGraph

huge.plot(L$path[[optMHrhoIndx]])title("Metropolis-Hastings sampling")

MHGraph

Reference

The MCPeSe method is described in:

Kuismin and Sillanpaa (2020). MCPeSe: Monte Carlo penalty selection for graphical lasso,Bioinformatics,https://doi.org/10.1093/bioinformatics/btaa734.

File "CodeCollection.zip" is a collection of scripts used to prepare the material in this paper.


[8]ページ先頭

©2009-2025 Movatter.jp