-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinference.R
62 lines (38 loc) · 2.29 KB
/
inference.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
setwd("~/workspace/Ltac_simulations")
source("simulation.R")
n_runs <- 10
n_days <- 300
#baseline
n_standard_wards <- 7
n_ltac_wards <- 0
beds_per_standard_ward <- 15
beds_per_ltac_ward <- 15
mean_length_of_stay <- 4
proportion_colonised_on_admission <- 0.1
within_ward_transmission_rate <- 0.02
for (run in 1:n_runs){
simulation_values <- data.frame(n_standard_wards,n_ltac_wards,beds_per_standard_ward,beds_per_ltac_ward,n_days,mean_length_of_stay,proportion_colonised_on_admission)
colnames(simulation_values) <- c("n_standard_wards","n_ltac_wards","beds_per_standard_ward","beds_per_ltac_ward","n_days","mean_length_of_stay","proportion_colonised_on_admission")
write.csv(simulation_values,paste("outfiles_simulations/simulation_values_baseline_",run,".csv",sep = ""))
output<- run_simulations(n_standard_wards, n_ltac_wards, beds_per_standard_ward, beds_per_ltac_ward,
n_days, mean_length_of_stay,proportion_colonised_on_admission, within_ward_transmission_rate)
write.csv(output[1],paste("outfiles_simulations/ptLog_baseline_",run,".csv",sep=""),row.names = FALSE)
write.csv(output[2],paste("outfiles_simulations/wardLog_baseline_",run,".csv",sep=""),row.names = FALSE)
}
#scenario 1
n_standard_wards <- 6
n_ltac_wards <- 1
beds_per_standard_ward <- 15
beds_per_ltac_ward <- 15
mean_length_of_stay <- 4
proportion_colonised_on_admission <- 0.1
within_ward_transmission_rate <- 0.02
for (run in 1:n_runs){
simulation_values <- data.frame(n_standard_wards,n_ltac_wards,beds_per_standard_ward,beds_per_ltac_ward,n_days,mean_length_of_stay,proportion_colonised_on_admission)
colnames(simulation_values) <- c("n_standard_wards","n_ltac_wards","beds_per_standard_ward","beds_per_ltac_ward","n_days","mean_length_of_stay","proportion_colonised_on_admission")
write.csv(simulation_values,paste("outfiles_simulations/simulation_values_s1_",run,".csv",sep = ""))
output<- run_simulations(n_standard_wards, n_ltac_wards, beds_per_standard_ward, beds_per_ltac_ward,
n_days, mean_length_of_stay,proportion_colonised_on_admission, within_ward_transmission_rate)
write.csv(output[1],paste("outfiles_simulations/ptLog_s1_",run,".csv",sep=""),row.names = FALSE)
write.csv(output[2],paste("outfiles_simulations/wardLog_s1_",run,".csv",sep=""),row.names = FALSE)
}