From 90d79ed3a85b1cac4fa5c37fcc3f5f3ae7876133 Mon Sep 17 00:00:00 2001 From: dj44vuri <julian.sagebiel@idiv.de> Date: Thu, 26 Oct 2023 11:52:54 +0200 Subject: [PATCH] added time output --- Projects/Agora/parameters_agora.R | 33 ++++++++++++++++++------------- generatemd.R | 4 ++-- simulation_output.rmd | 2 ++ simulationcore_purrr.R | 2 +- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/Projects/Agora/parameters_agora.R b/Projects/Agora/parameters_agora.R index dc5ff75..230833d 100644 --- a/Projects/Agora/parameters_agora.R +++ b/Projects/Agora/parameters_agora.R @@ -3,22 +3,27 @@ designpath<- "Projects/Agora/Designs/" resps =360 # number of respondents -nosim=1000 # number of simulations to run (about 500 is minimum) +nosim=2 # number of simulations to run (about 500 is minimum) #betacoefficients should not include "-" -#basc = -1.2 -#basc2 = -1.4 -#baction = 0.1 -#badvisory = 0.4 -#bpartner = 0.3 -#bcomp = 0.02 - -basc = -2.2 -basc2 = -2.7 -baction = -0.15 -badvisory = 0.26 -bpartner = -0.09 -bcomp = 0.004 + +#design priors parameters +basc = -1.2 +basc2 = -1.4 +baction = 0.1 +badvisory = 0.4 +bpartner = 0.3 +bcomp = 0.02 + + +# from survey + +# basc = -2.2 +# basc2 = -2.7 +# baction = -0.15 +# badvisory = 0.26 +# bpartner = -0.09 +# bcomp = 0.004 diff --git a/generatemd.R b/generatemd.R index 1381851..8fa2e7b 100644 --- a/generatemd.R +++ b/generatemd.R @@ -2,12 +2,12 @@ rm(list=ls()) #file <- "Projects/ValuGaps/parameters_valugaps.R" - file <- "Projects/Agora/parameters_agora.R" + file <- "Projects/SE_DRIVE/parameters_SE_DRIVE.R" rmarkdown::render("simulation_output.rmd", output_file = paste0(stringr::str_remove_all(file, - "parameters_|.R$"),"reecap.html"), + "parameters_|.R$"),".html"), params = list(file=file) ) diff --git a/simulation_output.rmd b/simulation_output.rmd index a417738..e5cc92b 100644 --- a/simulation_output.rmd +++ b/simulation_output.rmd @@ -36,6 +36,8 @@ print(combined_vector) The simulation has `r resps` respondents and `r nosim` runs. +The total time for estimation is `r all_designs[["time"]]`. + the parameters used for the simulation are: ```{r, echo=FALSE} diff --git a/simulationcore_purrr.R b/simulationcore_purrr.R index 345b601..465189b 100644 --- a/simulationcore_purrr.R +++ b/simulationcore_purrr.R @@ -34,7 +34,7 @@ time <- tictoc::toc() print(time) - +all_designs[["time"]]=time powa <- map(all_designs, ~ .x$power) -- GitLab