From bb1f8c7fecb6cce93e20fc609d38b988c56de461 Mon Sep 17 00:00:00 2001 From: Louis Lacoste Date: Wed, 19 Jun 2024 10:56:08 +0200 Subject: [PATCH] simulation : Fixing a generation seed and separating it from the inference --- code/simulations/clustering/synthetic_clustering.R | 3 ++- code/simulations/clustering/synthetic_generate_iid.R | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/simulations/clustering/synthetic_clustering.R b/code/simulations/clustering/synthetic_clustering.R index cd15baf..374658a 100644 --- a/code/simulations/clustering/synthetic_clustering.R +++ b/code/simulations/clustering/synthetic_clustering.R @@ -57,7 +57,6 @@ message( " et la seed ", seed ) -set.seed(seed, "L'Ecuyer-CMRG") save_folder <- file.path( here(), "code", "results", "simulations", "clustering", @@ -72,6 +71,8 @@ source(here("code", "simulations", "clustering", "synthetic_generate_iid.R")) netlist <- generate_synth_col(eps) +# Setting seed for inference +set.seed(seed, "L'Ecuyer-CMRG") start_time <- format(Sys.time(), "%d-%m-%y_%H-%M-%S") profvis( diff --git a/code/simulations/clustering/synthetic_generate_iid.R b/code/simulations/clustering/synthetic_generate_iid.R index 2791afd..7bb2364 100644 --- a/code/simulations/clustering/synthetic_generate_iid.R +++ b/code/simulations/clustering/synthetic_generate_iid.R @@ -1,5 +1,6 @@ -# Should not be used standalone ! +set.seed(0) +# Should not be used standalone ! base_alpha <- matrix(rep(0.3, 9L), nrow = 3L) pi <- c(0.3, 0.2, 0.5) rho <- c(0.55, 0.15, 0.3)