diff --git a/chin_sim_image/scripts/sim_run.R b/chin_sim_image/scripts/sim_run.R index 3a0cab0f80b4849cfe501cfdd0a512334c0250a4..ad00b01c6a04c9ca1aff3ca8d247b830c6136eaf 100644 --- a/chin_sim_image/scripts/sim_run.R +++ b/chin_sim_image/scripts/sim_run.R @@ -103,11 +103,11 @@ source("scripts/sim_variables.R") # Tuning matrix sim_tunemat <- read.csv("data/sim_tunemat.csv", header=TRUE) -summary(sim_tunemat) +# summary(sim_tunemat) # Dataset seeds sim_datamat <- read.csv("data/sim_datamat.csv", header=TRUE) -summary(sim_datamat) +# summary(sim_datamat) #### ####----5. SIMULATION FOR-LOOP----------------------------------------------#### @@ -116,17 +116,18 @@ summary(sim_datamat) ## For each N, run model for each simulated dataset and store ## parameter estimates -xtracores <- 16 +xtracores <- 25 # xtracores <- 3 nimblecores <- 9 -# nimblecores <- 3 +# nimblecores <- 2 nimblechains <- 9 # nimblechains <- 2 nset <- 150 nsim <- 100 +theseefficiencies <- "Max efficiency 0.1" arrResults <- array(data=NA, dim=c(length(nset)*2, nsim, 7, 300)) @@ -184,11 +185,11 @@ print(Sys.time()) thiscounter <- 0 # i <- 200 -# i <- 150 +# i <- 100 # nset <- 200 for (i in nset) { - theseefficiencies <- "Max efficiency 0.25" + # theseefficiencies <- "Max efficiency 0.1" # thisefficiency <- "Max efficiency 0.1" for (thisefficiency in theseefficiencies) { @@ -1225,9 +1226,9 @@ for (i in nset) { ##----Save simulation results/print to console - if(j %% 50 == 0) { + if(j %% 5 == 0) { - filename <- paste0('output/R_ss',i, '_', theseefficiencies ,'_',j,'.RData', collapse='') + filename <- paste0('output/R_ss',thiscounter,'_',j,'.RData', collapse='') save(arrResults, file=filename) } thisstring <- paste0("Completed one simulation: Sample size: ", i, @@ -1249,6 +1250,6 @@ print(Sys.time()) ##----6. Save output---- ## Save output array -thisstring <- paste0('output/R_nsim_', nsim, '_nset_', nset, '_', theseefficiencies ,'.RData', collapse='') +thisstring <- paste0('output/R_nsim_', nsim, '_nset_', nset, thisefficiency, '.RData', collapse='') save(arrResults, file=thisstring) # sessionInfo()