Skip to contents

Constructs a predictable betting-fraction sequence for the product-form strong-null e-process (eprocess_betting()), by mapping the constant-bound score-difference stream onto \([0,1]\) and running WSR's ONS-m algorithm (Waudby-Smith & Ramdas 2024, Online Supplementary Material, Algorithm 1, Section B.5), projected each round onto [0,1] instead of their native symmetric box, and evaluated at the fixed null \(m = 1/2\).

Usage

lambda_betting_ons(xs, c, eta = 2/(2 - log(3)))

Arguments

xs

Numeric vector. Score-difference stream \(\hat\delta_t = S(p_t,y_t) - S(q_t,y_t)\).

c

Numeric > 0. Either a scalar (constant bound) or a length-length(xs) predictable vector c_t (must satisfy |xs_t| <= c_t/2 pointwise, with c_t known before xs_t is observed). Scalars are recycled to a vector of the same length as xs.

eta

Numeric > 0. WSR's ONS step-size constant. Default 2 / (2 - log(3)), WSR's own stated value (natural log).

Value

Numeric vector of length length(xs): predictable \(\lambda_t\) values in [0, 1/c], for use as eprocess_betting()'s lambda_t argument together with c_t = c.

Details

Same Y_t = xs_t/c + 1/2 mapping as lambda_betting_agrapa(). WSR's Algorithm 1 is run exactly as stated, but using the standard OCO gradient for minimizing the negative log-wealth \(-\log(1 + \lambda y_t)\), and replacing WSR's own projection target [-c/(1-m), c/m] with [0, 1]. Following generic online-convex-optimization theory, \(\lambda_t^O\) is projected onto [0,1] before being used to compute the next round's gradient. Validity of the resulting e-process only requires the played lambda_d,t to lie in [0, 1/c] regardless of derivation.

This modification is original to this package.

References

Waudby-Smith, I. and Ramdas, A. (2024). Estimating means of bounded random variables by betting. Journal of the Royal Statistical Society Series B: Statistical Methodology, 86(1), 1–27.

Examples

xs <- c(0.6, -0.2, 0.4)
lambda_betting_ons(xs, c = 2)
#> [1] 0.0000000 0.3053396 0.1980564