diff --git a/articles/Unico-Tutorial.html b/articles/Unico-Tutorial.html index 4a40a02..7451311 100644 --- a/articles/Unico-Tutorial.html +++ b/articles/Unico-Tutorial.html @@ -88,10 +88,17 @@
library(Unico)
library(matrixStats)
+
+#For visualization in this vignette
+install.packages(c("ggplot2","ggpubr","hexbin"))
source("https://github.com/cozygene/Unico/raw/main/vignettes/vignetts.utils.r")
data = simulate_data(n = 100, m = 2, k = 3, p1 = 1, p2 = 1, taus_std = 0, log_file = NULL)
-#> INFO [2024-01-11 05:47:23] Start simulation ...
-#> INFO [2024-01-11 05:47:23] Finished simulation
+#> INFO [2024-01-11 06:43:02] Start simulation ...
+#> INFO [2024-01-11 06:43:02] Finished simulation
res = list()
res$params.hat = Unico(data$X, data$W, data$C1, data$C2, parallel=FALSE, log_file=NULL)
-#> INFO [2024-01-11 05:47:23] Starting Unico ...
-#> INFO [2024-01-11 05:47:23] Validate Unico inputs
-#> INFO [2024-01-11 05:47:23] Starting parameter learning ...
+#> INFO [2024-01-11 06:43:02] Starting Unico ...
+#> INFO [2024-01-11 06:43:02] Validate Unico inputs
+#> INFO [2024-01-11 06:43:02] Starting parameter learning ...
#>
| | 0 % ~calculating
|+++++++++++++++++++++++++ | 50% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
-#> INFO [2024-01-11 05:47:23] Formating results ...
-#> INFO [2024-01-11 05:47:23] Capping extreme values in estimated parameters
-#> INFO [2024-01-11 05:47:23] Finished parameter learning
+#> INFO [2024-01-11 06:43:02] Formating results ...
+#> INFO [2024-01-11 06:43:02] Capping extreme values in estimated parameters
+#> INFO [2024-01-11 06:43:02] Finished parameter learning
data = simulate_data(n = 100, m = 2, k = 3, p1 = 1, p2 = 1, taus_std = 0, log_file = NULL)
-#> INFO [2024-01-11 05:47:23] Start simulation ...
-#> INFO [2024-01-11 05:47:23] Finished simulation
+#> INFO [2024-01-11 06:43:03] Start simulation ...
+#> INFO [2024-01-11 06:43:03] Finished simulation
res = list()
res$params.hat = Unico(data$X, data$W, data$C1, data$C2, parallel=FALSE, log_file=NULL)
-#> INFO [2024-01-11 05:47:23] Starting Unico ...
-#> INFO [2024-01-11 05:47:23] Validate Unico inputs
-#> INFO [2024-01-11 05:47:23] Starting parameter learning ...
+#> INFO [2024-01-11 06:43:03] Starting Unico ...
+#> INFO [2024-01-11 06:43:03] Validate Unico inputs
+#> INFO [2024-01-11 06:43:03] Starting parameter learning ...
#>
| | 0 % ~calculating
|+++++++++++++++++++++++++ | 50% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
-#> INFO [2024-01-11 05:47:24] Formating results ...
-#> INFO [2024-01-11 05:47:24] Capping extreme values in estimated parameters
-#> INFO [2024-01-11 05:47:24] Finished parameter learning
+#> INFO [2024-01-11 06:43:03] Formating results ...
+#> INFO [2024-01-11 06:43:03] Capping extreme values in estimated parameters
+#> INFO [2024-01-11 06:43:03] Finished parameter learning
res$params.hat = association_asymptotic(data$X, res$params.hat, parallel=FALSE, log_file=NULL)
-#> INFO [2024-01-11 05:47:24] Validate asymptotic inputs ...
+#> INFO [2024-01-11 06:43:03] Validate asymptotic inputs ...
#> [1] 2 1
-#> INFO [2024-01-11 05:47:24] Preparing weights for asymptotic pvals calculation ...
-#> INFO [2024-01-11 05:47:24] Starting asymptotic pvals calculation: asymptotic ...
+#> INFO [2024-01-11 06:43:03] Preparing weights for asymptotic pvals calculation ...
+#> INFO [2024-01-11 06:43:03] Starting asymptotic pvals calculation: asymptotic ...
#>
| | 0 % ~calculating
|+++++++++++++++++++++++++ | 50% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
-#> INFO [2024-01-11 05:47:24] Finished asymptotic pvals calculation: asymptotic
+#> INFO [2024-01-11 06:43:03] Finished asymptotic pvals calculation: asymptotic
data = simulate_data(n = 100, m = 2, k = 3, p1 = 1, p2 = 1, taus_std = 0, log_file = NULL)
-#> INFO [2024-01-11 05:47:24] Start simulation ...
-#> INFO [2024-01-11 05:47:24] Finished simulation
+#> INFO [2024-01-11 06:43:03] Start simulation ...
+#> INFO [2024-01-11 06:43:03] Finished simulation
res = list()
res$params.hat = Unico(data$X, data$W, data$C1, data$C2, parallel=FALSE, log_file=NULL)
-#> INFO [2024-01-11 05:47:24] Starting Unico ...
-#> INFO [2024-01-11 05:47:24] Validate Unico inputs
-#> INFO [2024-01-11 05:47:24] Starting parameter learning ...
+#> INFO [2024-01-11 06:43:03] Starting Unico ...
+#> INFO [2024-01-11 06:43:03] Validate Unico inputs
+#> INFO [2024-01-11 06:43:03] Starting parameter learning ...
#>
| | 0 % ~calculating
|+++++++++++++++++++++++++ | 50% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
-#> INFO [2024-01-11 05:47:24] Formating results ...
-#> INFO [2024-01-11 05:47:24] Capping extreme values in estimated parameters
-#> INFO [2024-01-11 05:47:24] Finished parameter learning
+#> INFO [2024-01-11 06:43:04] Formating results ...
+#> INFO [2024-01-11 06:43:04] Capping extreme values in estimated parameters
+#> INFO [2024-01-11 06:43:04] Finished parameter learning
res$params.hat = association_parametric(data$X, res$params.hat, parallel=FALSE, log_file=NULL)
-#> INFO [2024-01-11 05:47:24] Validate parametric inputs ...
-#> INFO [2024-01-11 05:47:24] Preparing weights for parametric pvals calculation ...
-#> INFO [2024-01-11 05:47:24] Starting parametric pvals calculation: parametric ...
+#> INFO [2024-01-11 06:43:04] Validate parametric inputs ...
+#> INFO [2024-01-11 06:43:04] Preparing weights for parametric pvals calculation ...
+#> INFO [2024-01-11 06:43:04] Starting parametric pvals calculation: parametric ...
#>
| | 0 % ~calculating
|+++++++++++++++++++++++++ | 50% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
-#> INFO [2024-01-11 05:47:24] Finished parametric pvals calculation: parametric
+#> INFO [2024-01-11 06:43:04] Finished parametric pvals calculation: parametric
sim.data = simulate_data(n = 100, m = 5, k = 5, p1 = 1, p2 = 2, log_file = NULL)
-#> INFO [2024-01-11 05:47:24] Start simulation ...
-#> INFO [2024-01-11 05:47:24] Finished simulation
+#> INFO [2024-01-11 06:43:04] Start simulation ...
+#> INFO [2024-01-11 06:43:04] Finished simulation
data = simulate_data(n = 100, m = 2, k = 3, p1 = 1, p2 = 1, taus_std = 0, log_file = NULL)
-#> INFO [2024-01-11 05:47:25] Start simulation ...
-#> INFO [2024-01-11 05:47:25] Finished simulation
+#> INFO [2024-01-11 06:43:04] Start simulation ...
+#> INFO [2024-01-11 06:43:04] Finished simulation
res = list()
res$params.hat = Unico(data$X, data$W, data$C1, data$C2, parallel=FALSE, log_file=NULL)
-#> INFO [2024-01-11 05:47:25] Starting Unico ...
-#> INFO [2024-01-11 05:47:25] Validate Unico inputs
-#> INFO [2024-01-11 05:47:25] Starting parameter learning ...
+#> INFO [2024-01-11 06:43:04] Starting Unico ...
+#> INFO [2024-01-11 06:43:04] Validate Unico inputs
+#> INFO [2024-01-11 06:43:04] Starting parameter learning ...
#>
| | 0 % ~calculating
|+++++++++++++++++++++++++ | 50% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
-#> INFO [2024-01-11 05:47:25] Formating results ...
-#> INFO [2024-01-11 05:47:25] Capping extreme values in estimated parameters
-#> INFO [2024-01-11 05:47:25] Finished parameter learning
+#> INFO [2024-01-11 06:43:04] Formating results ...
+#> INFO [2024-01-11 06:43:04] Capping extreme values in estimated parameters
+#> INFO [2024-01-11 06:43:04] Finished parameter learning
res$Z = tensor(data$X, data$W, data$C1, data$C2, res$params.hat, parallel=FALSE, log_file=NULL)
-#> INFO [2024-01-11 05:47:25] Validate tensor inputs ...
-#> INFO [2024-01-11 05:47:25] Starting tensor ...
+#> INFO [2024-01-11 06:43:04] Validate tensor inputs ...
+#> INFO [2024-01-11 06:43:04] Starting tensor ...
#>
| | 0 % ~calculating
|+++++++++++++++++++++++++ | 50% ~00s
|++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s
-#> INFO [2024-01-11 05:47:25] Formating tensor result ...
-#> INFO [2024-01-11 05:47:25] Finished tensor estimation
+#> INFO [2024-01-11 06:43:04] Formating tensor result ...
+#> INFO [2024-01-11 06:43:04] Finished tensor estimation