The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

jewel_vignette

library(jewel)

In this vignette we demonstrate the usage of the jewel method for the estimation of networks. The vignette consists of three parts: generation of the artifical missing values into example dataset (since we need to know the true values for the performance evaluation), application of jewel and performance evaluation (we compare imputed values with the true ones).

Data generation

First, generate the data: 3 datasets with 100 variables and 50 samples. Their underlying graphs will have a quarter of edges not in common (can be tuned with perc parameter).

K <- 3
p <- 100
n <- 50
data <- generateData_rewire(K = K, p = p, n = n)
G_list_true <- data$Graphs
G_common_true <- data$CommonGraph
X <- data$Data

Applying jewel

Method jewel asks for some prior information on hubs if that is available to you. Let’s assume we do know which vertices are hubs. To simulate that, we’ll choose 3% of vertices with the highest degrees and put their degree to 10 (“hub”), while the rest is put to 1. Here we use only one graph because in simulation the degree distribution is the same by construction for all graphs.

true_degrees <- rowSums(G_list_true[[1]])
cut <- sort(true_degrees, decreasing = TRUE)[ceiling(p * 0.03)]
apriori_hubs <- ifelse(true_degrees >= cut, 10, 1)

Now construct the weights.

W <- constructWeights(apriori_hubs, K = K)

And now we estimate the graphs with user chosen \(\lambda_1\) and weights \(\mathbf{W}\) and with stability selection procedure

res <- jewel(X, lambda1 = 0.1, W = W, stability = TRUE)
G_list_est <- res$G_list
G_common_est <- res$CommonG

Performance evaluation

evaluatePerformance(G = G_common_true, G_hat = G_common_est)
mapply(evaluatePerformance, G_list_true, G_list_est)

Session info

sessionInfo()
#> R version 4.4.0 (2024-04-24)
#> Platform: x86_64-apple-darwin20
#> Running under: macOS Sonoma 14.4.1
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRblas.0.dylib 
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0
#> 
#> locale:
#> [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> time zone: Europe/Oslo
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] jewel_2.0.2
#> 
#> loaded via a namespace (and not attached):
#>  [1] vctrs_0.6.5       cli_3.6.2         knitr_1.46        rlang_1.1.3      
#>  [5] xfun_0.44         purrr_1.0.2       jsonlite_1.8.8    SMUT_1.1         
#>  [9] htmltools_0.5.8.1 sass_0.4.9        matrixcalc_1.0-6  rmarkdown_2.27   
#> [13] grid_4.4.0        evaluate_0.23     jquerylib_0.1.4   MASS_7.3-60.2    
#> [17] fastmap_1.2.0     yaml_2.3.8        lifecycle_1.0.4   compiler_4.4.0   
#> [21] RSpectra_0.16-1   igraph_2.0.3      pkgconfig_2.0.3   Rcpp_1.0.12      
#> [25] rstudioapi_0.16.0 lattice_0.22-6    digest_0.6.35     R6_2.5.1         
#> [29] parallel_4.4.0    magrittr_2.0.3    bslib_0.7.0       Matrix_1.7-0     
#> [33] tools_4.4.0       SPAtest_3.1.2     SKAT_2.2.5        cachem_1.1.0

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.