Skip to contents

Pre-computes the dynamic, pair-specific betting fractions required to evaluate the Sequential Model Confidence Set under the strong null hypothesis, using the aGRAPA algorithm.

Usage

build_agrapa_betting_array(scores, c_mat, period = 1, ...)

Arguments

scores

A \(T \times m\) matrix of positively-oriented scores.

c_mat

A numeric scalar, an \(m \times m\) matrix, or a \(T \times m \times m\) array of predictable bounds (matching the c_param argument of smcs_strong()).

period

Integer. If greater than 1, uses the periodic betting variant of aGRAPA, which updates the betting fraction only every period time steps.

...

Additional arguments passed to lambda_betting_agrapa() (e.g., kappa, prior_mean, prior_variance, fake_obs).

Value

A \(T \times m \times m\) numeric array of predictable betting fractions, suitable for passing to the lambda_param argument of smcs_strong().

Examples

set.seed(42)
y <- rbinom(50, 1, 0.5)
forecasts <- matrix(runif(150), nrow = 50, ncol = 3)
scores <- matrix(0, nrow = 50, ncol = 3)
for (i in 1:3) scores[, i] <- brier_score(forecasts[, i], y)

# For Brier scores, differences are bounded in [-1, 1], so c = 2
lam_array <- build_agrapa_betting_array(scores, c_mat = 2)
dim(lam_array) # 50 x 3 x 3
#> [1] 50  3  3