Skip to contents

Integrates the conditional TV bound over \(\alpha \sim \text{Gamma}(a, b)\) to obtain the marginal error bound.

Usage

expected_tv_bound(
  J,
  a,
  b,
  cJ = log(J),
  M = .QUAD_NODES_DEFAULT,
  M_verify = NULL,
  abs_tol = 1e-10,
  rel_tol = 1e-08,
  strict = FALSE
)

Arguments

J

Integer; sample size.

a, b

Numeric; Gamma hyperparameters.

cJ

Numeric; scaling constant (default: log(J)).

M

Integer; number of nodes for a secondary Gauss-Laguerre audit.

M_verify

Optional independent order at least max(2*M, M+40) and no greater than 512 for the secondary audit.

abs_tol, rel_tol

Non-negative adaptive selected-versus-verification tolerances. They are also used and reported for the Gauss-Laguerre audit.

strict

Logical; if TRUE, require successful agreement between two independently controlled adaptive integrations and otherwise raise a typed dpprior_tv_bound_convergence_error.

Value

Numeric; \(E[d_{TV} \text{ bound} | a, b]\). The scalar carries a "tv_bound_metadata" attribute with status, numerical error and omitted-tail allowances, discrepancies, a Gauss-Laguerre audit, and theorem provenance. The returned conservative adaptive upper bound is never silently replaced by either verification value.

Details

From the submitted manuscript Appendix D, Theorem thm:marginal-tv (Equation D17), the TV error between the exact prior predictive \(p(S_J | a, b)\) and the A1 Negative-Binomial proxy is bounded by: $$d_{TV}(P^{\text{exact}}, Q^{A1}) \le E_{\alpha \sim \Gamma(a,b)}[B_{\text{Pois}} + B_{\text{lin}}]$$

This follows from the mixture contraction property of TV distance. The expectation is evaluated on log-alpha by adaptive quadrature over central Gamma quantiles. The returned value adds both the integrator's reported absolute error and the full omitted Gamma-tail probability to the numerical estimate. A tighter independently controlled integration determines the convergence status. Fixed-order Gauss-Laguerre values are retained in the metadata as a reproducibility audit because their convergence can be non-monotone for this capped, non-smooth integrand.

Examples

if (FALSE) { # \dontrun{
# Marginal TV bound for J=100, Gamma(1, 1)
expected_tv_bound(J = 100, a = 1, b = 1)

} # }