Skip to content
Snippets Groups Projects
Commit b0fc82cf authored by Margarete Walden's avatar Margarete Walden
Browse files

Replace sim_run.R due to unknown error. Set to nset 150, eff .1, nsim 100.

parent 236d3faa
No related branches found
No related tags found
No related merge requests found
......@@ -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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment