In this script, we consider the stock price data for a number of time points as in the huge R package.

library(glasso)
library(corpcor)
library(CorShrink)
library(network)
source("isee_all.R")
library(scales)
library(statnet)
library(huge)
library(corrplot)
data(stockdata) # Load the data
x = log(stockdata$data[2:1258,]/stockdata$data[1:1257,])  # Preprocessing
x.npn = huge.npn(x, npn.func="truncation")                # Nonparanormal
## Conducting nonparanormal (npn) transformation via truncated ECDF....done.
out.npn = huge(x.npn,method = "glasso", nlambda=40,lambda.min.ratio = 0.4)
## Conducting the graphical lasso (glasso) with lossless screening....in progress:0% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:2% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:5% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:7% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:9% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:12% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:15% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:17% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:19% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:22% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:25% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:27% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:30% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:32% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:35% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:37% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:40% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:42% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:44% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:47% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:50% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:52% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:55% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:57% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:60% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:62% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:65% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:67% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:70% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:72% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:75% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:77% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:80% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:82% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:85% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:87% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:90% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:92% 
Conducting the graphical lasso (glasso) with lossless screening....in progress:95% 
Conducting the graphical lasso (glasso)....done.                                          
dim(out.npn$icov[[1]])
## [1] 452 452
pcor4 <- pCorShrinkData(x,reg_type = "lm",
                        maxiter = 1000,
                        ash.control = list(mixcompdist = "halfuniform"))
save(pcor4, file = "stockdata_pcorshrink_lm.rda")
pcor4 <- get(load("stockdata_pcorshrink_lm.rda"))
col2 <- c("blue", "white", "red")
tmp = apply(pcor4, 2, function(x) sort(x, decreasing = TRUE)[2])
idx <- which(tmp > 0.25)
pcor5 <- pcor4[idx, idx]
corrplot(pcor5, diag = FALSE, col = colorRampPalette(col2)(200), tl.pos = "td", 
         tl.col = "black", tl.cex = 0.05, rect.col = "white", 
         na.label.col = "white", method = "color", type = "upper")

A <- ifelse(pcor5 > 0.1 & row(pcor5)!=col(pcor5),1,0)

g <- network(A)
plot(g,label=1:dim(pcor5)[1],
     main="Estimated network by pCorShrink+LM")

ISEE

regfactor = "log"  # or "one", "sqrt"
npermu = 1         # or >= 2
sis.use = 0        # or 1, whether to use SIS for screening
bia.cor = 0        # or 1, whether to apply bias correction for ISEE
obj.n = isee(x, regfactor, npermu, sis.use, bia.cor = 0) 
pcor2 <- -cov2cor(obj.n$Omega.isee)
diag(pcor2) <- 1
save(pcor2, file = "stockdata_isee.rda")
pcor2 <- get(load("stockdata_isee.rda"))
col2 <- c("blue", "white", "red")
tmp = apply(pcor2, 2, function(x) sort(x, decreasing = TRUE)[2])
idx <- which(tmp > 0.25)
pcor3 <- pcor2[idx, idx]
corrplot(pcor3, diag = FALSE, col = colorRampPalette(col2)(200), tl.pos = "td", 
         tl.col = "black", tl.cex = 0.05, rect.col = "white", 
         na.label.col = "white", method = "color", type = "upper")

A <- ifelse(pcor3 > 0.1 & row(pcor3)!=col(pcor3),1,0)

g <- network(A)
plot(g,label=1:dim(pcor5)[1],
     main="Estimated network by ISEE")