# Obtain wmt2 data
wmt <- wmt2[,7:24]
# Set seed (for reproducibility)
set.seed(1234)
# Split data
split1 <- sample(
1:nrow(wmt), floor(nrow(wmt) / 2)
)
split2 <- setdiff(1:nrow(wmt), split1)
# Obtain split data
data1 <- wmt[split1,]
data2 <- wmt[split2,]
# Perform EBICglasso
glas1 <- EBICglasso.qgraph(data1)
glas2 <- EBICglasso.qgraph(data2)
# Spectral JSD
jsd(glas1, glas2) # 0.1618195
# Spectral JSS (similarity)
1 - jsd(glas1, glas2) # 0.8381805
# Jensen-Shannon Divergence
jsd(glas1, glas2, method = "kld") # 0.1923636
Run the code above in your browser using DataLab