-
Notifications
You must be signed in to change notification settings - Fork 1
/
accuracy_analysis.r
40 lines (33 loc) · 1.26 KB
/
accuracy_analysis.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
library(ggplot2)
library(dplyr)
library(glue)
gr <- (sqrt(5) + 1) / 2
stdW <- 8
comp <- read.csv("data/COMP_comparisons.csv")
head(comp)
names(comp)
## Methods: Gaunt (NA values), Naive, Old_brms, New_brms, Adaptive
for (mtd in c("ST", "errorBounding", "brms", "brms_bulk")){
g <- ggplot(na.omit(comp) %>% filter(method == mtd),
aes(y = as.factor(mu), x = as.factor(nu))) + theme_bw()+
geom_tile(aes(fill = as.factor(below_tolerance),
color = as.factor(below_tolerance))) +
facet_wrap(vars(as.factor(log10(eps)))) +
labs(x = "Nu", y = "Mu", fill = "Beat tol.") + guides(color = FALSE) +
theme(axis.text = element_text(size = 5))
ggsave(glue("figs/{mtd}_beatTol.pdf"), plot = g, device="pdf",
width = stdW, height = stdW / gr)
}
## percent comparisons
comp %>%
group_by(method) %>%
summarise(perc_beat_tol = mean(below_tolerance)) %>%
ungroup()
comp %>%
group_by(eps) %>%
summarise(gaunt = mean(below_tolerance[method == "Gaunt"]),
naive = mean(below_tolerance[method == "ST"]),
adaptive = mean(below_tolerance[method == "errorBounding"]),
brms = mean(below_tolerance[method == "brms"]),
brms_bulk = mean(below_tolerance[method == "brms_bulk"])) %>%
ungroup()