for report : inference adding boxplot but not using it

This commit is contained in:
Louis Lacoste 2024-08-09 10:36:44 +02:00
parent 239b502e4d
commit 04c93bf6ec

View file

@ -289,6 +289,22 @@ averaged_data <- result_data_frame |>
group_by(epsilon_alpha, model, ARI_type, dim) |>
summarise(across(everything(), list("mean" = mean, "sd" = sd)))
unaveraged_data <- result_data_frame |>
group_by(epsilon_alpha) |>
select(-contains(c("BICL", "pi1", "rho2", "Q1", "Q2", "elapsed_secs", "preferred_model", "repetition"))) |>
pivot_longer(contains("ARI"), names_pattern = "([a-zA-Z\\_]*)_ARI", values_to = "ARI") |>
separate(name, sep = "_", into = c("model", "ARI_type", "dim")) |>
mutate(
model = forcats::fct_relevel(
model,
"sep", "iid", "pi", "rho", "pirho"
),
ARI_type = forcats::fct_relevel(ARI_type, "mean", "double"),
dim = forcats::fct_relevel(dim, "row", "col")
) |>
ungroup() |>
group_by(epsilon_alpha, model, ARI_type, dim)
dim.labs <- c("$d = 1$", "$d = 2$")
names(dim.labs) <- c("row", "col")
ARI_type.labs <- c("$\\overline{\\mbox{ARI}}_d$", "$\\mbox{ARI}_d$")
@ -298,6 +314,10 @@ levels(averaged_data$model) <- c(
"sep", "$iid$", "$\\pi$", "$\\rho$",
"$\\pi\\rho$"
)
levels(unaveraged_data$model) <- c(
"sep", "$iid$", "$\\pi$", "$\\rho$",
"$\\pi\\rho$"
)
ARI_plots <- ggplot(averaged_data) +
aes(x = epsilon_alpha, y = ARI_mean, color = model) +
@ -324,6 +344,23 @@ ARI_plots <- ggplot(averaged_data) +
theme_minimal() +
theme(aspect.ratio = 1L, axis.text.x = element_text(angle = -45, vjust = .5, hjust = 0))
# ggplot(unaveraged_data) +
# aes(x = as.factor(epsilon_alpha), y = ARI, color = model) +
# geom_boxplot()+
# scale_color_okabe_ito() +
# scale_fill_okabe_ito() +
# facet_grid(ARI_type ~ dim, labeller = labeller(
# ARI_type = ARI_type.labs,
# dim = dim.labs
# )) +
# guides(
# fill = guide_legend(title = "Model"),
# color = guide_legend(title = "Model")
# ) +
# labs(y = "", x = "$\\epsilon_{\\alpha}$") +
# theme_minimal() +
# theme(aspect.ratio = 1L, axis.text.x = element_text(angle = -45, vjust = .5, hjust = 0))
tikz(
file = file.path(output_tikz_folder, "ari-plots.tex"), width = 6L,
height = 5L,