-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_experiments.R
76 lines (59 loc) · 2.28 KB
/
create_experiments.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
################################################################################
# R script that creates experiments #
################################################################################
library(tidyverse)
grid_size = 30
problem_size = 25
base_experiment = tibble(ccm = 100,
cpm = 0.2 * ccm,
C = 0.4 * ccm,
nStates = problem_size + 1,
dL = 1.0,
pi = problem_size,
nRates = problem_size + 1,
mu = 1.0,
var = 1.0,
dT = 1.0,
minProb = 0.99,
beta = 0.1,
alpha = 1.5,
eps = 0.0000001,
nUnits = 2)
experiments = base_experiment
#### Define all experiments ####
# Function to create experiment rows
create_experiments = function(variableName, values) {
new_experiments = base_experiment[rep(1, length(values)),]
new_experiments[[variableName]] = values
return(new_experiments)
}
# Variance experiments
var_options = seq(0.5, 5, length.out=grid_size)
experiments = experiments %>%
bind_rows(create_experiments("var", var_options))
# Fixed cost effect
fixed_cost_options = seq(0, 200, length.out=grid_size)
experiments = experiments %>%
bind_rows(create_experiments("C", fixed_cost_options))
# Preventive effect
preventive_cost_options = seq(0, 100, length.out=grid_size)
experiments = experiments %>%
bind_rows(create_experiments("cpm", preventive_cost_options))
# Beta
b_options = seq(0, 1, length.out=grid_size)
experiments = experiments %>%
bind_rows(create_experiments("beta", b_options))
# Alpha
alpha_options = seq(0, 3, length.out=grid_size)
experiments = experiments %>%
bind_rows(create_experiments("alpha", alpha_options))
# Pi
pi_options = seq(20, 50, by=5)
experiments = experiments %>%
bind_rows(create_experiments("pi", pi_options))
# Set alpha
alpha_options = c(0, 0.5, 1)
experiments = experiments %>%
bind_rows(create_experiments("alpha", alpha_options))
#### Output the experiments table ####
write.table(experiments, file="data/experiment_input", row.names=FALSE, col.names=FALSE)