Skip to content

Commit

Permalink
last state at handover to Liming
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Sabanés Bové committed Jun 26, 2024
1 parent b10a061 commit 8fb99ca
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
################################################################################

# load required libraries
library(reticulate)
use_virtualenv("daniel")
library(simChef)
library(mmrm)
library(glmmTMB)
Expand All @@ -19,7 +21,7 @@ library(microbenchmark)

# source the R scripts
sim_functions_files <- list.files(
c("R/dgp", "R/method", "R/eval", "R/viz"),
c("R/dgp", "R/method", "R/eval", "R/viz", "R/customizations"),
pattern = "*.R$", full.names = TRUE, ignore.case = TRUE
)
sapply(sim_functions_files, source)
Expand All @@ -30,7 +32,7 @@ csh_cov_mat <- compute_csh_matrix()
toep_cov_mat <- toeplitz(c(1, 0.5, 0.25, 0.125, rep(0, 6)))

# set the sample size
n_obs <- 600
n_obs <- 200

# dgps with no treatment effect
no_effect_us_dgp <- create_dgp(
Expand Down Expand Up @@ -157,8 +159,8 @@ type_2_error_rate_eval <- create_evaluator(

# create the experiment
experiment <- create_experiment(
name = "mmrm-benchmark-extreme-missingness-n-600-SAS",
save_dir = "results/extreme-miss/n-600-SAS"
name = glue::glue("mmrm-benchmark-extreme-missingness-n-{n_obs}-SAS"),
save_dir = glue::glue("results/extreme-miss/n-{n_obs}-SAS")
) %>%
add_dgp(no_effect_us_dgp, name = "no_effect_us") %>%
add_dgp(no_effect_csh_dgp, name = "no_effect_csh") %>%
Expand Down Expand Up @@ -188,32 +190,30 @@ experiment <- create_experiment(
add_evaluator(type_1_error_rate_eval, name = "type_1_error_rate") %>%
add_evaluator(type_2_error_rate_eval, name = "type_2_error_rate")

# # Determine host name
# hostname <- "sabanesd-nwpfwh-eu.ocean"
#
# # Do this to register host
# session <- ssh::ssh_connect(hostname)
# ssh_disconnect(session)
#
# # We can also be specific if there are multiple SAS containers we want to connect to.
# cfg_name <- "~/sascfg_personal.py"
# sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name)
# options(sascfg = cfg_name)
#
# # Test if it works.
# df <- data.frame(a = 1, b = 2)
# sasr::df2sd(df)
# Determine host name
hostname <- "sabanesd-w2yc52-eu.ocean"

# run the experiment
# set.seed(713452)
# results <- experiment$run(
# n_reps = 1000,
# save = TRUE,
# verbose = 2,
# checkpoint_n_reps = 10
# )
# Do this to register host
session <- ssh::ssh_connect(hostname)
ssh_disconnect(session)

source("R/format-replicate-results/helpers.R")
# We can also be specific if there are multiple SAS containers we want to connect to.
cfg_name <- "~/sascfg_personal.py"
sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name)
options(sascfg = cfg_name)

format_fit_and_save(experiment)
# Test if it works.
df <- data.frame(a = 1, b = 2)
sasr::df2sd(df)

# run the experiment
set.seed(713452)
results <- experiment$run(
n_reps = 1000,
save = TRUE,
use_cached = TRUE,
verbose = 2,
checkpoint_n_reps = 100
)

format_fit_and_save(experiment)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
################################################################################

# load required libraries
library(reticulate)
use_virtualenv("daniel")
library(simChef)
library(mmrm)
library(glmmTMB)
Expand All @@ -19,7 +21,7 @@ library(microbenchmark)

# source the R scripts
sim_functions_files <- list.files(
c("R/dgp", "R/method", "R/eval", "R/viz"),
c("R/dgp", "R/method", "R/eval", "R/viz", "R/customizations"),
pattern = "*.R$", full.names = TRUE, ignore.case = TRUE
)
sapply(sim_functions_files, source)
Expand All @@ -30,7 +32,7 @@ csh_cov_mat <- compute_csh_matrix()
toep_cov_mat <- toeplitz(c(1, 0.5, 0.25, 0.125, rep(0, 6)))

# set the sample size
n_obs <- 600
n_obs <- 200

# dgps with no treatment effect
no_effect_us_dgp <- create_dgp(
Expand Down Expand Up @@ -157,8 +159,8 @@ type_2_error_rate_eval <- create_evaluator(

# create the experiment
experiment <- create_experiment(
name = "mmrm-benchmark-high-missingness-n-600-SAS",
save_dir = "results/high-miss/n-600-SAS"
name = glue::glue("mmrm-benchmark-high-missingness-n-{n_obs}-SAS"),
save_dir = glue::glue("results/high-miss/n-{n_obs}-SAS")
) %>%
add_dgp(no_effect_us_dgp, name = "no_effect_us") %>%
add_dgp(no_effect_csh_dgp, name = "no_effect_csh") %>%
Expand Down Expand Up @@ -188,31 +190,29 @@ experiment <- create_experiment(
add_evaluator(type_1_error_rate_eval, name = "type_1_error_rate") %>%
add_evaluator(type_2_error_rate_eval, name = "type_2_error_rate")

# # Input here the name of the SAS container.
# hostname <- "sabanesd-k2n72p-eu.ocean"
#
# # Do this to register host
# session <- ssh::ssh_connect(hostname)
# ssh_disconnect(session)
#
# # We can also be specific if there are multiple SAS containers we want to connect to.
# cfg_name <- "sascfg_personal_2.py"
# sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name)
# options(sascfg = cfg_name)
#
# # Test if it works.
# df <- data.frame(a = 1, b = 2)
# sasr::df2sd(df)
# Input here the name of the SAS container.
hostname <- "sabanesd-k2lza0-eu.ocean"

# run the experiment
# set.seed(713452)
# results <- experiment$run(
# n_reps = 1000,
# save = TRUE,
# verbose = 2,
# checkpoint_n_reps = 10
# )
# Do this to register host
session <- ssh::ssh_connect(hostname)
ssh_disconnect(session)

# We can also be specific if there are multiple SAS containers we want to connect to.
cfg_name <- "sascfg_personal_3.py"
sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name)
options(sascfg = cfg_name)

source("R/format-replicate-results/helpers.R")
# Test if it works.
df <- data.frame(a = 1, b = 2)
sasr::df2sd(df)

# run the experiment
set.seed(235234)
results <- experiment$run(
n_reps = 1000,
save = TRUE,
verbose = 2,
checkpoint_n_reps = 100
)

format_fit_and_save(experiment)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
################################################################################

# load required libraries
library(reticulate)
use_virtualenv("daniel")
library(simChef)
library(mmrm)
library(glmmTMB)
Expand All @@ -19,7 +21,7 @@ library(microbenchmark)

# source the R scripts
sim_functions_files <- list.files(
c("R/dgp", "R/method", "R/eval", "R/viz"),
c("R/dgp", "R/method", "R/eval", "R/viz", "R/customizations"),
pattern = "*.R$", full.names = TRUE, ignore.case = TRUE
)
sapply(sim_functions_files, source)
Expand All @@ -30,7 +32,7 @@ csh_cov_mat <- compute_csh_matrix()
toep_cov_mat <- toeplitz(c(1, 0.5, 0.25, 0.125, rep(0, 6)))

# set the sample size
n_obs <- 600
n_obs <- 200

# dgps with no treatment effect
no_effect_us_dgp <- create_dgp(
Expand Down Expand Up @@ -157,8 +159,8 @@ type_2_error_rate_eval <- create_evaluator(

# create the experiment
experiment <- create_experiment(
name = "mmrm-benchmark-low-missingness-n-600-SAS",
save_dir = "results/low-miss/n-600-SAS"
name = glue::glue("mmrm-benchmark-low-missingness-n-{n_obs}-SAS"),
save_dir = glue::glue("results/low-miss/n-{n_obs}-SAS")
) %>%
add_dgp(no_effect_us_dgp, name = "no_effect_us") %>%
add_dgp(no_effect_csh_dgp, name = "no_effect_csh") %>%
Expand Down Expand Up @@ -188,31 +190,29 @@ experiment <- create_experiment(
add_evaluator(type_1_error_rate_eval, name = "type_1_error_rate") %>%
add_evaluator(type_2_error_rate_eval, name = "type_2_error_rate")

# # Input here the name of the SAS container.
# hostname <- "sabanesd-byknxg-eu.ocean"
#
# # Do this to register host
# session <- ssh::ssh_connect(hostname)
# ssh_disconnect(session)
#
# # We can also be specific if there are multiple SAS containers we want to connect to.
# cfg_name <- "sascfg_personal_3.py"
# sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name)
# options(sascfg = cfg_name)
#
# # Test if it works.
# df <- data.frame(a = 1, b = 2)
# sasr::df2sd(df)
# Input here the name of the SAS container.
hostname <- "sabanesd-9nb6cb-eu.ocean"

# run the experiment
# set.seed(56129)
# results <- experiment$run(
# n_reps = 1000,
# save = TRUE,
# verbose = 2,
# checkpoint_n_reps = 10
# )
# Do this to register host
session <- ssh::ssh_connect(hostname)
ssh_disconnect(session)

# We can also be specific if there are multiple SAS containers we want to connect to.
cfg_name <- "sascfg_personal_3.py"
sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name)
options(sascfg = cfg_name)

source("R/format-replicate-results/helpers.R")
# Test if it works.
df <- data.frame(a = 1, b = 2)
sasr::df2sd(df)

# run the experiment
set.seed(56129)
results <- experiment$run(
n_reps = 1000,
save = TRUE,
verbose = 2,
checkpoint_n_reps = 100
)

format_fit_and_save(experiment)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
################################################################################

# load required libraries
library(reticulate)
use_virtualenv("daniel")
library(simChef)
library(mmrm)
library(glmmTMB)
Expand All @@ -19,7 +21,7 @@ library(microbenchmark)

# source the R scripts
sim_functions_files <- list.files(
c("R/dgp", "R/method", "R/eval", "R/viz"),
c("R/dgp", "R/method", "R/eval", "R/viz", "R/customizations"),
pattern = "*.R$", full.names = TRUE, ignore.case = TRUE
)
sapply(sim_functions_files, source)
Expand All @@ -30,7 +32,7 @@ csh_cov_mat <- compute_csh_matrix()
toep_cov_mat <- toeplitz(c(1, 0.5, 0.25, 0.125, rep(0, 6)))

# set the sample size
n_obs <- 600
n_obs <- 200

# dgps with no treatment effect
no_effect_us_dgp <- create_dgp(
Expand Down Expand Up @@ -148,8 +150,8 @@ type_2_error_rate_eval <- create_evaluator(

# create the experiment
experiment <- create_experiment(
name = "mmrm-benchmark-no-missingness-n-600-SAS",
save_dir = "results/no-miss/n-600-SAS"
name = glue::glue("mmrm-benchmark-no-missingness-n-{n_obs}-SAS"),
save_dir = glue::glue("results/no-miss/n-{n_obs}-SAS")
) %>%
add_dgp(no_effect_us_dgp, name = "no_effect_us") %>%
add_dgp(no_effect_csh_dgp, name = "no_effect_csh") %>%
Expand Down Expand Up @@ -178,33 +180,31 @@ experiment <- create_experiment(
add_evaluator(coverage_eval, name = "coverage_rate") %>%
add_evaluator(type_1_error_rate_eval, name = "type_1_error_rate") %>%
add_evaluator(type_2_error_rate_eval, name = "type_2_error_rate")
#
# # Input here the name of the SAS container.
# hostname <- "sabanesd-ddi1zu-eu.ocean"
#
# # Do this to register host
# session <- ssh::ssh_connect(hostname)
# ssh_disconnect(session)
#
# # We can also be specific if there are multiple SAS containers we want to connect to.
# cfg_name <- "sascfg_personal_4.py"
# sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name)
# options(sascfg = cfg_name)
#
# # Test if it works.
# df <- data.frame(a = 1, b = 2)
# sasr::df2sd(df)
#
# # run the experiment
# set.seed(62342)
# results <- experiment$run(
# n_reps = 1000,
# save = TRUE,
# verbose = 2,
# checkpoint_n_reps = 10
# )

source("R/format-replicate-results/helpers.R")
# Input here the name of the SAS container.
hostname <- "sabanesd-m55pe7-eu.ocean"

# Do this to register host
session <- ssh::ssh_connect(hostname)
ssh_disconnect(session)

# We can also be specific if there are multiple SAS containers we want to connect to.
cfg_name <- "sascfg_personal_4.py"
sasr.roche::setup_sasr_ocean(hostname, sascfg = cfg_name)
options(sascfg = cfg_name)

# Test if it works.
df <- data.frame(a = 1, b = 2)
sasr::df2sd(df)

# run the experiment
set.seed(62342)
results <- experiment$run(
n_reps = 1000,
save = TRUE,
verbose = 2,
checkpoint_n_reps = 100
)

format_fit_and_save(experiment)

2 changes: 1 addition & 1 deletion simulations/missing-data-benchmarks/sascfg_personal.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SAS_config_names=['default']
default={'host': 'sabanesd-nwpfwh-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992}
default={'host': 'sabanesd-w2yc52-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992}
2 changes: 1 addition & 1 deletion simulations/missing-data-benchmarks/sascfg_personal_2.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SAS_config_names=['default']
default={'host': 'sabanesd-k2n72p-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992}
default={'host': 'sabanesd-n5i2d5-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992}
2 changes: 1 addition & 1 deletion simulations/missing-data-benchmarks/sascfg_personal_3.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SAS_config_names=['default']
default={'host': 'sabanesd-byknxg-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992}
default={'host': 'sabanesd-k2lza0-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992}
2 changes: 1 addition & 1 deletion simulations/missing-data-benchmarks/sascfg_personal_4.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SAS_config_names=['default']
default={'host': 'sabanesd-ddi1zu-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992}
default={'host': 'sabanesd-m55pe7-eu.ocean', 'saspath': '/opt/sas/SASHome/SASFoundation/9.4/sas', 'ssh': '/usr/bin/ssh', 'encoding': 'latin1', 'options': ['-fullstimer'], 'tunnel': 9991, 'rtunnel': 9992}

0 comments on commit 8fb99ca

Please sign in to comment.