Skip to content

chc.regret

Stability tier: evolving.

Its research half moved to chc.research.regret in 0.19.0.

Certainty-equivalence suboptimality for LQ control -- CHC's regret guarantee (LQ special case).

For a linear-quadratic problem the certainty-equivalent controller (solve the LQR for an estimated model, then apply that gain to the true plant) has a suboptimality gap that is quadratic in the model error: J(K_hat) - J* <= O(||[dA, dB]||^2) in the small-error regime, provided the estimated controller stabilises the true plant. This LOCAL quadratic bound is Mania, Tu & Recht (2019), which improved the earlier LINEAR-in-error robust-synthesis bound of Dean, Mania, Matni, Recht & Tu (2018); it is a small-error suboptimality bound, not a global equality. This is the analysable special case of CHC's pessimism story -- small model error costs almost nothing, but the penalty grows with error, which is exactly what the calibrated uncertainty penalty (chc.uncertainty) is there to price in offline.

A NumPy/scipy analysis tool (like chc.did / chc.scm), independent of the JAX x64 flag. The infinite-horizon discrete LQR is solved via the DARE; a controller's true-plant cost via the discrete Lyapunov equation.

The certificates that each back one research result -- the regret scaling and its constants, orthogonal, multi-channel and transfer control, the information and Van Trees floors, interference and fold designs, the exact ratio moments and the confounding-robust controllers -- moved to chc.research.regret in 0.19.0. What stays here is the LQ solve and the certainty-equivalence gap, the exploration certificates and the capped exploration policy, and the minimax-regret actions, moves and LQ policies.

MinimaxBranch = Literal['lower', 'upper', 'equalise', 'zero', 'interior'] module-attribute

Which candidate the robust action landed on. lower / upper are the certainty-equivalent actions for an interval endpoint, equalise the action that makes both endpoints equally bad (b_hat*u = target for the cost, the sqrt(D)-weighted mean of the endpoint actions for the regret), zero doing nothing -- the answer when the sign is unidentified -- and interior a regret whose worst effect lies inside the interval.

MoveRule = Literal['sign', 'linear'] module-attribute

Which minimax-regret rule minimax_regret_move took: sign makes the whole move where its estimate is not negative and holds otherwise; linear makes a share of it that rises linearly from 0 to 1 across [-threshold, threshold].

CERegretLaw dataclass

The law of the certainty-equivalent controller's regret under a Gaussian model error, to second order, beside the exact regret's: what ce_regret_law returns.

weights are the generalised chi-square's, largest first: the second-order regret is sum_k weights_k chi2_1. mean is their sum, the second-order mean, and quantiles the law's quantiles at levels. exact_quantiles are the exact regret's at the same levels over draws model errors, inf where the destabilising draws reach them. destabilise_probability is the share of draws whose gain does not stabilise the true plant or does not exist, and destabilise_upper its one-sided 95 % Clopper-Pearson bound. fourth_order_share is the next term of the mean over the second-order one, c4 / c2 at the covariance given, and valid holds when it is at most the tolerance asked.

OptimalExplorationCurve dataclass

Explore-exploit for causal control: excess(v) = Av + B/v is minimised at v = sqrt(B/A).

AdaptiveExplorationCurve dataclass

Adaptive exploration: a tapering schedule reaches the van-Trees sqrt(T) rate.

MinimaxExplorationCurve dataclass

The sequential minimax floor: no policy beats it, a front-loaded design attains it.

CappedExplorationPolicy dataclass

The optimal exploration schedule under a per-round action cap: a clipped burst.

For a constant cap the policy is three numbers: explore for block_rounds rounds, at cap in all but the last and at last_round in that one, then stop. It is not an approximation -- the objective is convex and depends on the schedule only through its prefix sums, so front-loading as hard as the box allows is globally optimal, and the exchange argument leaves at most one round below its cap.

When the cap VARIES or a total budget is imposed, the invariant is not the block length but exploration_mass: the first-order condition sees the cap level nowhere, only the mass already delivered and the rounds left after the round that delivers it, so the schedule moves the mass only through that round (validation/capped_exploration_schedule.mac).

MinimaxAction dataclass

The robust action, its worst case over the interval, and which candidate bound.

worst_case is the worst of whatever was minimised: the cost, or the regret.

MinimaxRegretMove dataclass

How much of a move to make where its value is known only to an interval around a noisy estimate, and what that costs at worst. Experimental.

See minimax_regret_move.

MinimaxLQPolicy dataclass

Robust finite-horizon feedback over a partially identified effect, beside its CE rival.

MinimaxLQCertificate dataclass

Evidence that the closed form is the minimiser, beats CE, and how much the DP relaxes.

dlqr(a, b, q, r)

Infinite-horizon discrete LQR: optimal gain K and cost-to-go P (via the DARE).

closed_loop_cost(a, b, k, q, r, x0)

Infinite-horizon LQ cost of applying gain k to plant (a, b) from x0.

x0' P x0 where P solves the discrete Lyapunov equation for the closed loop; +inf if k fails to stabilise (a, b) (a destabilising controller has unbounded cost).

certainty_equivalence_gap(a, b, q, r, a_hat, b_hat, x0)

Suboptimality J(K_hat) - J* of the certainty-equivalent controller on the true plant.

K_hat is the LQR-optimal gain for the estimated model (a_hat, b_hat); the gap is its true-plant cost minus the cost of the true-optimal gain. Zero iff the estimate induces the optimal gain; otherwise non-negative (the optimum is optimal). +inf if K_hat fails to stabilise the true plant.

Read as x0' D x0, where D = P_K_hat - P* solves the Lyapunov equation D = (A - B K_hat)' D (A - B K_hat) + dK' (R + B' P* B) dK with dK = K_hat - K* (derived in validation/ce_gap_cost_difference.mac): the cost-difference lemma of Fazel, Ge, Kakade and Mesbahi (ICML 2018; Lemma 10 of the supplementary material and of arXiv 1801.05039 v3) at K = K*, where the advantage's cross term vanishes. The forcing is positive semi-definite, so the gap is a sum of non-negative terms and keeps its relative accuracy as it shrinks. The difference of the two costs, each of order x0' P* x0, loses every digit once the gap falls below eps x0' P* x0: on a 3-state plant with each entry of B off by 1e-8 it read 0.0 against a true 2.15e-16, and -4.4e-15 against 3.1e-15 at 3.8e-8.

ce_regret_law(a, b, q, r, covariance, state_moment, *, levels=(0.5, 0.9, 0.99), draws=10000, tolerance=0.05, seed=0)

The law of the certainty-equivalent LQ regret when the model (A_hat, B_hat) is the truth plus a Gaussian error of covariance.

covariance is over theta = (A.ravel(), B.ravel()), row-major, n^2 + n m entries. The regret is tr(state_moment D), D that of certainty_equivalence_gap: np.outer(x0, x0) reads the cost from a start x0, as that function does, and a noise covariance reads the long-run average cost per step.

The exact regret is tr(W D) with W = state_moment and D = A_cl_hat' D A_cl_hat + dK' (R + B' P* B) dK, and +inf where A - B K_hat is not stable. Its mean is infinite under any Gaussian error: destabilising errors have positive probability, and even given stability the spectral radius of A - B K_hat has a positive density at 1, where the regret has a simple pole, so the conditional mean diverges as well. Its quantiles exist, which is why they are reported, and why chc.research.regret.regret_scaling reads medians.

To second order dK = G e, G the gain's Jacobian, with the closed loop at the optimum, so the regret is e' M e, M = G' (Sigma* (x) (R + B' P* B)) G and Sigma* = sum_j A_cl^j W A_cl'^j: under e ~ N(0, S) a generalised chi-square whose weights are the eigenvalues of S^1/2 M S^1/2. Its quantiles are inverted from Imhof's (1961) formula. P(destabilise) and the exact quantiles are read off draws draws of the exact identity.

The second-order law is the small-error limit. How far it holds is read off the next term of the mean of an estimator safeguarded away from the stability edge, E R = c2 + c4 + ..., c4 = (1/8) (S : grad^2)^2 R the Gaussian mean of the regret's fourth-order Taylor term: fourth_order_share = c4 / c2, read by a degree-5 Gaussian rule (Stroud 1971) on the exact regret at three small scales of the covariance and extrapolated to zero. On the scalar plant x' = a x + b u + w with unit noise and q = 1 under an isotropic error s^2 I, c2 = 2.3416 s^2 and c4 = 10.401 s^4 at (a, b, r) = (1, 1, 1), 20.191 and 348.37 at (1.2, 0.5, 1), 1.1000 and 5.6069 at (0.5, 1, 0.1) (validation/ce_regret_law.mac). Over 2 000 000 draws on those plants the exact median stayed within 1 % of the law's while no draw destabilised, and the mean truncated at a stability margin of 0.01 was within 0.3 % of c2 + c4 wherever the share was 0.05 or less; at shares of 0.17 and 0.18 it was 1.29 and 1.33 times the second-order mean. valid is fourth_order_share <= tolerance. A Gaussian error is itself an asymptotic statement about a fitted model.

Raises:

Type Description
ValueError

when the shapes disagree, covariance or state_moment is not symmetric positive semi-definite, a level lies outside (0, 1), draws is below 1, or the true plant has no stabilising gain.

optimal_exploration_certificate(*, b=0.3, rr=0.2, xt=1.0, sigma=1.0, n=30, kappa_conf=0.4, grid_lo=0.02, grid_hi=3.0, n_grid=15, n_seeds=1000)

Optimal exploration for causal control -- the actionable DUAL of the Cramer-Rao lower bound (derived in validation/optimal_exploration.mac, proved in proofs/optimal_exploration.v). Injecting exploration variance v buys identifying information (shrinking the estimation floor B/v, B=C*sigma^2/n) but is itself an action error costing A*v control (A=b^2+rr, by completing-the-square). The total excess A*v + B/v is minimal at v* = sqrt(B/A), irreducible cost 2*sqrt(A*B) (AM-GM). The optimum is interior -- pure exploitation is never optimal -- and confounding raises B (here via a fraction kappa of identifying signal), lifting BOTH v* and the floor. The estimation term is Monte-Carlo; the A*v term is the proven CE cost of the injected variance.

SCOPE of B/v: it is the large-n form. The estimation arm fits least squares on n Gaussian rounds, whose mean squared error is sigma^2/((n-2)*v) exactly, an inverse chi-square mean (validation/optimal_exploration.mac). So the simulated cost is n/(n-2) times B/v, 7% above it at the default n = 30, and its optimum lies sqrt(n/(n-2)) times vstar_theory out, 1.035 at n = 30, inside one step of the default grid (a ratio of 1.43). The arm's mean is infinite for n <= 2 and its variance for n <= 4: there its Monte Carlo average does not settle.

adaptive_exploration_certificate(*, b=1.0, rr=0.5, xt=1.0, sigma=0.5, m0=1.0, eta=1.0, static_v=0.05, horizons=(50, 150, 500, 1500, 5000), schedule_horizon=400)

ADAPTIVE information-exploration duality (derived in validation/adaptive_exploration.mac, proved in proofs/adaptive_exploration.v). At round t the controller injects v_t that raises accumulated Fisher information m_t = m0 + eta*sum_{s<t} v_s for FUTURE rounds, where eta in (0,1] is the identifying information PER UNIT exploration (eta=1 identified, eta->0 confounded). The per-round regret is A*v_t + K/m_t, K/m_t the van-Trees (Bayesian Cramer-Rao) floor -- valid for adaptive data, unlike ordinary Cramer-Rao (algebraic core in proofs/van_trees.v). Its numerator is K = C*sigma^2 with C = A*(du*/db)^2, the convention validation/adaptive_exploration.mac states in its first line: the observation noise enters it, so sigma moves both the bound and the schedule scale. The RATE-OPTIMAL schedule v_t = kappa/sqrt(t) achieves Theta(sqrt(T)), matching the Theta(sqrt(T)) sequence lower bound >= 2*sqrt(A*K*T/eta) - A*m0/eta (Rocq reduced_objective_lower_bound with a=A/eta, where the Rocq C is this K, proves its one-variable core a*x + C*T/x >= 2*sqrt(a*C*T); the reduction from the sequence is not in Rocq), NOT a corollary of the per-round floor. The leading term scales as 1/sqrt(eta), where eta is the INJECTED-EXPLORATION efficiency (information per unit exploration variance, distinct from an observational residual fraction): smaller eta provably raises the leading term 2*sqrt(A*K*T/eta) (Rocq lower_efficiency_raises_sequence_floor); the whole floor rises only while eta > A*m0^2/(K*T), below which its -A*m0/eta term wins -- this 1/sqrt(eta) is identification-efficiency-specific (attenuation: noncompliance, dilution, partial observability, interference -- NOT necessarily confounding; eta=1 for clean directly-observed randomisation), the causal content the generic bound lacked. Greedy is Theta(T); the static v* (optimal_exploration_certificate) over-explores. SCOPE: the t^{-1/2} schedule, sqrt(T) rate and van-Trees sqrt(T) lower bounds are KNOWN in adaptive LQR (Ziemann and Sandberg, IEEE TAC 2025, arXiv 2201.01680; Wagenmaker et al.); the FULL minimax constant is no longer open -- minimax_exploration_certificate proves it over ALL policies and shows this schedule pays a factor sqrt(2) over that floor. Conditions: m0=O(1); exploitation adds no identifying information; exploration information is linear in v_t (else greedy need not be Theta(T)). The myopic max(0, sqrt(K/A)-m_t) rule is a DIFFERENT (one-shot) object.

capped_exploration_policy(*, horizon, cap, budget=None, b=1.0, rr=0.5, xt=1.0, sigma=0.7, i0=1.0, eta=0.6)

The matching causal policy under a per-round action cap.

minimax_exploration_certificate showed that a front-loaded BURST attains the minimax floor while a 1/sqrt(t) taper sits sqrt(2) above it, and conjectured that a per-round action cap -- which every real actuator has -- is what would make the taper the right shape. It is not. The regret

``F(v) = A sum_t v_t + K sum_t 1/(I0 + c S_{t-1})``,  ``S`` the prefix sum,
``c = eta/sigma^2``

depends on the schedule only through its prefix sums and is strictly decreasing in each of them, so moving exploration from a later round to an earlier one at equal budget STRICTLY lowers it (proofs/capped_exploration.v, earlier_is_strictly_cheaper) -- an argument that never mentions the cap. The Hessian is a sum of rank-one PSD terms, so the objective is convex and the exchange argument gives a GLOBAL optimum: saturate the cap on a prefix, fill at most one more round partly, then stop. A clipped burst, not a taper. The partial round is worth 6.8e-4 of 3.078 at T = 50, cap = 0.3 and 3e-6 at T = 1e5, cap = 0.03; a whole block alone can be worth less than not exploring at all -- at T = 10, cap = 3 one round at the cap costs 4.72 against 0.74 for none.

The price of the cap is ADDITIVE and LOGARITHMIC, not a constant factor. The optimal block length is n* = sqrt(K T/(A c))/cap TO LEADING ORDER -- exactly it is ceil(S*/cap) for the exact mass S* derived below, smaller by a constant -- and at it the leading term is 2 sqrt(A K T/c), which with K = A (du*/db)^2 and c = eta/sigma^2 is EXACTLY the uncapped constant c_causal sqrt(T) (capped_leading_term_is_the_uncapped_floor). What is left over is the harmonic sum, (K/(2 c cap)) ln T + O(1) -- so the ratio to the uncapped floor tends to 1 for every fixed cap, while the taper's sqrt(2) does not. A tighter actuator explores for LONGER, not more gently.

block_rounds is found by an exact search over the convex block-cost curve, which digamma makes O(1) per candidate, and the last round's amount in closed form on the two rounds next to the best whole block; cost is the true cost of that schedule, the convex program's minimum to rounding. taper_cost is the clipped 1/sqrt(t) schedule at its own optimal scale, for comparison -- at T = 1e5 and cap = 0.03 the block costs 196.11 against the taper's 266.81, a 36% gap that does not close.

predicted_excess carries only the LEADING log term; its O(1) is not modelled, so read it as a slope rather than a level. Per decade of T at cap = 0.03 it predicts 2.32 against a measured 2.20 then 2.29 -- converging, which is the claim.

A VARYING cap, or a total budget on top of it, is the harder case: the exchange argument still says "as early as feasible", but n* is then not a single number. It turns out n* was never the invariant. The first-order condition is

``dF/dn = cap(n) [ A - K c (T - n) / (I0 + c S(n))^2 ]``

(validation/capped_exploration_schedule.mac STEP 2b, residual 0), whose bracket contains the cap nowhere -- only the mass S(n) delivered so far. So the optimal exploration MASS solves

``A (I0 + c S)^2 = K c (T - n)``,  with ``n`` the round the prefix sum delivers ``S``

where that root falls inside round n. Where it skips a round boundary, the optimum is the boundary: the cost falls up to it and rises after it (STEP 9). The cap LEVEL enters only through the round that reaches the mass. The mass is not free of the horizon: n sits inside its own condition, so predicted_mass is a fixed point over the integer round rather than a closed form, and the cap-free sqrt(K T/(A c)) - I0/c is the n << T limit -- 25% high as soon as the caps open late.

Under a CONSTANT cap a continuous RELAXATION of that fixed point has a closed form, and it says what the cap-free form drops. Reading the stopping round as n = S/cap, not as the integer round that delivers S, makes the remaining horizon a function of the mass and the condition a QUADRATIC in w = I0 + c S,

``A w^2 + (K/cap) w = K c T + K I0/cap``

whose cap-free counterpart is the same balance with the horizon held at the full T, A w0^2 = K c T. Subtracting the two kills T entirely and leaves A (w0^2 - w^2) = K c S/cap, so the cap-free form OVER-states the relaxation's mass at every finite horizon -- never under-states it -- by (w0 - w)/c <= K/(2 A c cap), a CONSTANT rather than a vanishing remainder (proofs/capped_exploration_schedule.v section (H)). At the defaults and cap = 0.01 the ceiling is 2.016, approached strictly from below as 1.834, 1.959, 1.998, 2.011, 2.015 over T = 1e4 .. 1e8, the remainder decaying like (K + 4 A I0 cap) sqrt(K/(A c)) / (8 A c cap^2 sqrt(T)) (STEP 7 of validation/capped_exploration_schedule.mac, confirmed to 60 digits by validation/capped_exploration_o1.gp). It is the TIGHT actuator the omission hurts: at T = 4000 the over-statement is 0.5% of the mass at cap = 0.3 and 17% at cap = 0.01.

The relaxation is not the optimum. The round that delivers S is ceil(S/cap), up to one round after S/cap, so the exact mass -- predicted_mass, and exploration_mass where no budget binds -- lies between the quadratic's roots at the horizons T - 1 and T (STEP 9d): below the root at T by less than cap, and by less than K/(2 A w) with w the root at T - 1 (STEP 9f). At A = 1, K = 4, c = 1, I0 = 1, T = 3 the optimum at cap = 100 is one partial round of sqrt(8) - 1 = 1.828427 against the root's 2.449928, and at cap = 4/5 the schedule (4/5, 1/5, 0), mass 1 at cost 83/9, against the root's 1.321825 (STEP 9g, 9h). So the ceiling above is the relaxation's. The cap-free form over-states the exact mass by at least the relaxation's gap and by less than K/(2 A c cap) + sqrt(K T/(A c)) - sqrt(K (T - 1)/(A c)), whose last two terms vanish like 1/sqrt(T): the limit is the same constant, but at a finite horizon the gap can pass it, 0.635674 against a ceiling of 0.02 at cap = 100 above.

A budget does not interact with the caps either: below the root the objective is strictly decreasing in the mass, so a binding budget is spent in full, as early as the caps allow. The two collapse to

deliver mass ``min(budget, S*)``, greedily -- ``block_rounds`` is where the prefix sum of
the caps first reaches it.

cap therefore takes either a scalar or a per-round schedule of length horizon. What does NOT become cap-free is the COST: delivering the same mass earlier is strictly cheaper, so two schedules with the same prefix mass at n* still cost differently. The stopping rule is the invariant, not the value. A prefix of ZERO caps is the sharp case -- it adds exactly m K/I0 and hands the rest of the horizon to the same problem, so a dead actuator has a price and not a distortion.

Scope: as in minimax_exploration_certificate -- the van Trees score identity for a functional under an adaptive design and Fisher-information additivity are cited, not formalised, and exploitation is assumed to contribute no identifying information.

minimax_exploration_certificate(*, b=1.0, rr=0.5, xt=1.0, sigma=0.7, i0=1.0, eta=0.6, constant_v=0.01, horizons=(10 ** 3, 10 ** 4, 10 ** 5, 10 ** 6, 10 ** 7), eta_grid=(0.1, 0.2, 0.4, 0.7, 1.0))

The FULL LOCAL-MINIMAX sequential lower bound with an EXPLICIT constant (derived in validation/minimax_exploration.mac, proved in proofs/minimax_exploration.v).

adaptive_exploration_certificate gave a sequence bound: over exploration schedules, inside an assumed per-round decomposition, with an opaque floor numerator K. This closes both gaps. Splitting any policy's action into its conditional mean and conditional variance is an identity (Rocq action_variance_decomposition), so the inf runs over ALL policies, not schedules; and van Trees on the functional u*(theta) identifies the numerator as K = A*(du*/db)^2*sigma^2. The result is

``inf_pi sup_theta E R_T >= c_causal*sqrt(T) - O(1)``,
``c_causal = 2*A*|du*/db|*sigma/sqrt(eta)``,

with A the local cost curvature in the action, du*/db the decision sensitivity of the oracle action, sigma^2 the noise, and eta in (0,1] the identifying information per unit injected exploration variance. The sup is over a shrinking neighbourhood of radius H*T^(-1/4) -- not the usual T^(-1/2), since the optimiser sits at order sqrt(T) and a T^(-1/2) prior would swamp the data information -- with the limits taken T -> inf first, then H -> inf, as in the clustered result.

Two things this certificate shows that the rate alone does not. The floor is attained: the crude step (every denominator at the total budget) is an equality exactly when information is raised immediately, so a front-loaded burst hits it and burst_over_floor -> 1 -- the constant is sharp. And tapering costs a constant factor: the 1/sqrt(t) schedule, even at its own optimal scale, sits at sqrt(2) times the floor (the two constants are Maxima's; Rocq taper_gap_is_sqrt_two checks that their squared ratio is 2). The burst is optimal in this model, where exploration cost is linear in the injected variance and unbounded per round. A per-round action cap does NOT rescue the taper -- the capped optimum is a cap-saturating BLOCK, still front-loaded, whose price over this floor is an additive logarithm; see capped_exploration_policy.

SCOPE, as elsewhere in this line: Rocq proves the algebra. The van Trees score identity for a functional under an adaptive design, and Fisher-information additivity along the trajectory, are cited (Gill-Levit 1995; Gassiat-Stoltz 2024), not formalised. The model assumes exploitation contributes no identifying information -- that is what eta encodes.

minimax_action(target, b_lo, b_hi, effort, curvature=1.0, *, criterion='cost')

Exact argmin_u max_{b in [b_lo, b_hi]} curvature*(b*u - target)^2 + effort*u^2.

Certainty equivalence is not minimax for the LQ loss (Rocq ce_not_minimax is a counterexample); this is the robust controller, in closed form rather than by search (validation/minimax_lq.mac, proofs/minimax_lq.v).

Two facts make it closed-form. The stage cost is convex in b with curvature 2*curvature*u^2 >= 0, so the inner maximum is attained at an endpoint and the outer problem is the minimisation of a max of two convex quadratics. Those two branches cross at exactly two points, u = 0 and the equalising action u = target/b_hat -- both of them, which is why the candidate set is enumerated rather than reasoned about by the sign of u. A convex piecewise quadratic attains its minimum at a branch minimiser or at a kink, so evaluating the four candidates is exact, not a heuristic.

On an interval of one sign the choice is decided by curvature*|b_0|*(b_hi - b_lo)/2 <= effort, b_0 the endpoint nearest zero -- b_lo on a positive interval, b_hi on a negative one, for a target of either sign: below it the answer is the CE action for that pessimistic endpoint, above it the equalising action. proofs/minimax_lq.v proves the rule for 0 <= u and b_hi u <= target; the rest is the symmetry (b, u) -> (-b, -u), and an interval containing zero is left to the enumeration. And the correction does NOT have a fixed sign -- the robust action is smaller than CE at b_hat only when curvature*b_lo*b_hat < effort, and larger otherwise. "Be robust, act less" is a statement about expensive effort, not about pessimism.

criterion="regret" minimises the worst regret instead: the cost over what the action that knew b would have paid, D(b) (u - u*(b))^2 with D(b) = curvature*b^2 + effort and u*(b) = curvature*b*target/D(b). The two answers differ: on the five intervals of its test the minimax-cost action carries 4.1-6.2x the minimax regret. The regret's worst effect is an endpoint unless sqrt(D) (u - u*) turns inside the interval, which happens exactly where u*b*D(b) - target*effort changes sign on it -- that root test decides the case, and a monotone u* does not: on b in [1, 10] with unit weights the endpoint answer is 20% low. With no turn, the answer is the endpoint equaliser, (sqrt(D_lo)*u*_lo + sqrt(D_hi)*u*_hi) / (sqrt(D_lo) + sqrt(D_hi)); with one, the worst regret is evaluated at the endpoints and the turn, is convex in u, and is minimised over the range of u* by golden section.

minimax_regret_move(estimate, standard_error, gamma, cvar_gap=1.0, size=1.0)

How much of a move to make when its value is linear in the channel, its estimate is noisy, and confounding up to gamma may bias it: the minimax-regret rule of Montiel Olea, Qiu and Stoye (Review of Economic Studies 2026; arXiv 2312.17623 v3, Section 4.2). Experimental.

The move's estimated value is estimate ~ N(beta, standard_error^2), the standard error its influence's, and its true value lies in [beta - k, beta + k], k = (gamma - 1)/(gamma + 1) * cvar_gap * size: the marginal sensitivity model's half-width, with the gap a share of size, the channel's size on the move's scale, as ADR 0085 sizes it; size = 1 reads cvar_gap in the move's own units. A rule makes the move with probability d. Where the move's value is u > 0 its regret is u (1 - E d), and where u < 0 it is -u E d.

  • k <= sqrt(pi/2) standard_error: the sign rule, the whole move where the estimate is not negative, is minimax regret, and essentially the only rule that is. Its worst regret is max over beta of (beta + k) Phi(-beta / standard_error).
  • Past it every minimax-regret rule randomises, the minimax regret is k / 2, and the rule that randomises least makes clip((estimate + rho) / (2 rho), 0, 1) of the move, with rho = k (1 - 2 Phi(-rho / standard_error)), the one root in (0, k]. The sign rule loses more there: 1.0509 against 1.000 at k = 2, standard_error = 1, and 3.371 against 2.5 at k = 5 (validation/minimax_regret_move.mac).

MinimaxRegretMove.full_move_gamma is the largest gamma at which the estimate still makes the whole move. The share is 1 while rho <= estimate, and rho grows with k, so the move is whole up to k = estimate / erf(estimate / (standard_error sqrt 2)), which exceeds estimate. So the move stays whole past the flip (G + d)/(G - d) of the noiseless identified set, where the set already holds values below zero: the noise is a regret the confounding's hedge cannot buy back, and below sqrt(pi/2) standard_error the sign rule moves whole on any estimate that is not negative. The Gamma falls to the flip as the error shrinks.

For linear welfare only: a value linear in the move, an estimate Gaussian about its mean, and a half-width that does not depend on the data. A cost quadratic in the action, as minimax_action's, has another minimax rule, which this one does not approximate.

Raises:

Type Description
ValueError

on an estimate that is not finite, a standard error that is negative or not finite, a gamma below 1 or not finite, or a cvar_gap or size that is negative or not finite.

minimax_lq_policy(state_gain, b_lo, b_hi, state_cost, effort, terminal_cost, horizon)

Robust Riccati recursion for x' = a*x + b*u with b only known to lie in an interval.

The Bellman step is homogeneous of degree two in (x, u), so substituting u = s*x turns it into exactly the static problem of minimax_action with target = -a and curvature = p_{k+1} (identity (8) of validation/minimax_lq.mac). The robust policy is therefore linear feedback with a closed form per step, not a minimax search, and the value function stays quadratic.

The adversary re-picks b at every step, which is what makes dynamic programming apply and is normally a strict relaxation of a constant unknown effect. Here it is not, and that is a result rather than a caveat: identity (9) shows the robust action always leaves the endpoint nearest zero (weakly) worst, decided by the same kink rule that picked the branch, so the per-step optimum is realised by that constant effect -- b_lo on a positive interval, b_hi on a negative one (a = 1, b in [-2, -1], q = r = 1, T = 2: value 1.5, which b_hi costs and b_lo does not, 1.25), and both endpoints on an interval containing zero. The value is the constant-effect worst case rather than an upper bound on it, and minimax_lq_certificate measures that instead of assuming it.

HONEST SCOPE. Scalar state and scalar effect: the interval is the MSM sensitivity interval for one control channel, and the multivariate lift is not this function.

minimax_lq_certificate(state_gain=1.0, b_hat=1.0, state_cost=1.0, effort=1.0, terminal_cost=1.0, horizon=5, halfwidths=(0.0, 0.1, 0.25, 0.5), grid=200001)

Check the closed form against brute force, against CE, and against its own DP relaxation.

Three things, and the third is the one that could embarrass the entry. (i) On the Rocq counterexample the closed form must return the action a fine grid search finds, and must beat the CE action's worst case: action 0.4 against 0.5, worst case 0.8 against 0.8125. (ii) Over a sweep of interval half-widths the robust worst case must stay at or below CE's and grow with the width. (iii) The robust policy is derived against an adversary that re-picks the effect every step, which is normally a strict relaxation; relaxation_ratio measures the price of it against a grid of constant effects, and lower_endpoint_margin measures the structural reason the price is zero -- the lower endpoint is the worst one at every step.