Empirical Bernstein confidence sequence (Theorem 2, Choe & Ramdas 2023)
Source:R/confidence_sequences.R
cs_bernstein.RdConstructs a variance-adaptive time-uniform CS using empirical intrinsic time \(\hat{V}_t = \sum_{i=1}^t (\hat{\delta}_i - \gamma_i)^2\). Tighter than the Hoeffding CS when score differences have low variance.
Usage
cs_bernstein(
scores1,
scores2,
alpha = 0.05,
c = 2,
v_opt = 10,
boundary = "mixture",
gammas = NULL,
lcb_only = FALSE,
ucb_only = FALSE
)Arguments
- scores1
Numeric vector. Scores for forecaster 1.
- scores2
Numeric vector. Scores for forecaster 2.
- alpha
Numeric in (0,1). Significance level. Default: 0.05.
- c
Numeric > 0. Sub-exponential scale. The process must satisfy |hat_delta_i| <= c/2. For score differences in
[a-b, b-a], c = b - a (e.g. c = 2 for Brier score differences in[-1,1]). Default: 2.- v_opt
Numeric > 0. Optimal intrinsic time. Default: 10.
- boundary
Character. "mixture" (default, GE mixture) or "stitching" (polynomial stitched) or "hardcoded" (CR23 example formula, only valid for alpha=0.05, c=1).
- gammas
Numeric vector or NULL. Predictable centering sequence. If NULL, constructed as lagged running mean (default).
- lcb_only
Logical. If TRUE, return lower CS only:
[lower, +Inf). Requires finite lower bound on hat_delta_i; provide c.- ucb_only
Logical. If TRUE, return upper CS only:
(-Inf, upper].
Value
data.frame with columns t, estimate, lower, upper. lower = -Inf if ucb_only = TRUE; upper = Inf if lcb_only = TRUE.