For each dimension computes a t-based CI:
mean +/- t(alpha/2, n-1) * (SD / sqrt(n)) where alpha = 1 - conf_level.
Value
Numeric matrix (n_dims x 3): columns are [mean, ci_lower, ci_upper].
When nrow(points) == 1 the CI bounds are -Inf and Inf.
Examples
pts <- matrix(c(1, 2, 3, 4, 10, 12, 11, 13), ncol = 2)
mean_ci(pts) # rows = dimensions; columns = mean, lower, upper
#> [,1] [,2] [,3]
#> [1,] 2.5 0.4457397 4.55426
#> [2,] 11.5 9.4457397 13.55426
t.test(pts[, 1])$conf.int # same bounds as row 1
#> [1] 0.4457397 4.5542603
#> attr(,"conf.level")
#> [1] 0.95