feat: add confidence interval to table; add IQR to plot

This commit is contained in:
gmega 2025-01-30 11:49:39 -03:00
parent 61f2172304
commit 5cba77eb99
No known key found for this signature in database
GPG Key ID: 6290D34EAD824B18
2 changed files with 11 additions and 0 deletions

View File

@ -141,11 +141,18 @@ completion_time_stats <- function(download_times, meta) {
p05 = quantile(completion_times, p = 0.05),
p10 = quantile(completion_times, p = 0.10),
p20 = quantile(completion_times, p = 0.20),
p25 = quantile(completion_times, p = 0.25),
median = median(completion_times),
p75 = quantile(completion_times, p = 0.75),
p80 = quantile(completion_times, p = 0.80),
p90 = quantile(completion_times, p = 0.90),
p95 = quantile(completion_times, p = 0.95),
max = max(completion_times),
iqr = p75 - p25,
# This gives us roughly a 95% ci for comparing medians.
ci = (1.58 * iqr) / sqrt(n),
w_top = median + ci,
w_bottom = median - ci
)
}

View File

@ -67,6 +67,10 @@ We then plot the median by network size, and facet it by seeder ratio and file s
```{r fig.width = 10, warning=FALSE, message=FALSE}
ggplot(benchmarks) +
geom_ribbon(aes(ymin = p25, ymax = p75, x = network_size),
fill = scales::alpha('blue', 0.5), col = 'lightgray') +
geom_point(aes(x = network_size, y = p25), col = 'darkgray', size=10.0, shape='-') +
geom_point(aes(x = network_size, y = p75), col = 'darkgray', size=10.0, shape='-') +
geom_line(aes(x = network_size, y = median)) +
geom_point(aes(x = network_size, y = median)) +
ylab('median download time (seconds)') +