Skip to content

chc.plan

Stability tier: stable.

The one-call spine: plan a control sequence and get its guarantees attached to it.

Everything here already existed -- constrained OC (chc.control), the offline pessimism and uncertainty penalties (chc.support, chc.uncertainty), and the certified Gronwall error tube with its safe horizon. What was missing was a single object that carries a plan together with the evidence about where it may be trusted, so a caller cannot walk away with the actions and leave the certificate behind.

plan = causal_plan(model, x0, cost, dt=0.1, horizon=20, u_lo=-5.0, u_hi=5.0,
                   lipschitz=0.8, model_error=0.05, tolerance=0.5)
plan.actions              # the full sequence
plan.certified_actions    # only the prefix whose error tube is inside tolerance
plan.certified_horizon    # where that prefix ends
plan.shadow_prices()      # what each constraint row is worth to the plan

With no safety arguments this is exactly chc.control.projected_gradient_control with the trajectory and cost packaged; each safety argument switches on one existing layer, so the defaults promise nothing that was not asked for.

Three modes, deliberately named apart, because "safety" alone does not say which one you get:

  • plan -- causal_plan. Box constraints in the solve -- optionally intersected with linear rows over the whole sequence, such as a budget or a rate limit -- plus an a-priori Gronwall error tube that says how far ahead the plan may be trusted. The tube is computed from lipschitz and model_error, and from the plant's own one-step noise where it is given; it does not enter the objective and does not move a single action. A BarrierConstraint does: passed as barrier=, the audit's own condition is held in the solve by augmented-Lagrangian rounds (docs/adr/0002-barrier-in-the-solve.md).
  • audit -- certify_safety. Given a barrier and a sensitivity level Gamma, it prices a finished plan against the robust barrier condition of chc.barrier: where along it the safety guarantee survives unmeasured confounding, and the largest Gamma the whole plan tolerates. Read-only by construction.
  • filter -- chc.barrier.robust_safety_filter. It clips one nominal action into the certified interval at one state, online, scalar control.

A held barrier binds the answer, not every iterate as the box and the rows do, and the solver's word is not taken for it: a solve stopped by its budget, or a condition no admissible action can meet, comes back short of the condition, and CausalPlan.safety -- the audit, run on the finished plan -- says so. The tube is still never imposed inside the optimisation, so a plan can leave tolerance at step 3; that is why CausalPlan.certified_actions exists.

CertificateStatus = Literal['not_evaluated', 'no_tolerance', 'uncertified', 'partial', 'certified'] module-attribute

How far a plan's error tube trusts it: not_evaluated where no error model gave it a tube, no_tolerance where the tube was read against an infinite tolerance, which holds every finite radius and so certifies nothing, and otherwise uncertified, partial or certified as none, some or all of its steps keep the tube within the tolerance.

InnerSolve = Literal['diagonal', 'newton', 'orthant'] module-attribute

How each augmented-Lagrangian round of a held barrier is solved (causal_plan's inner): diagonal, the penalised descent in the round's diagonal Gauss-Newton metric; newton, Bertsekas' projected Newton method on the round's dense curvature, the descent taking over where a Newton step fails; or orthant, the same Newton method on the box cut at each step's centre, on whose either side the condition's norm of a one-lever action is linear, so that an action comes to rest on the norm's kink exactly.

OuterRule = Literal['halved', 'safeguarded'] module-attribute

How the augmented-Lagrangian rounds of a held barrier share their budget and grow their penalty (causal_plan's outer): halved, each round given half of the steps left and a round the budget cut growing no penalty, or safeguarded, each round given a fixed share of 333 steps, the default budget over 30 rounds, rounds until the budget is spent, and the penalty grown on every round whose measure fails to halve, cut or not.

DiagnosticStatus = Literal['within', 'beyond', 'not_finite', 'not_evaluated'] module-attribute

How a plan's stationarity or constraint violation reads against its tolerance: within it, beyond it, not_finite where the number is nan or infinite, as where the rollout left the float range, and not_evaluated where it was not read: a plan built by hand.

CostBiasDirection = Literal['optimistic', 'pessimistic', 'unbiased', 'unknown'] module-attribute

Which way a planned cost reads against what the plan pays the plant, in expectation: optimistic where it reads low, a positive bias, pessimistic where it reads high, and unknown where the bias is nan.

Barrier = Callable[[Array], Array] | tuple[Callable[[Array], Array], ...] module-attribute

h, safe where h >= 0; or a tuple of them, safe where each is, each its own condition.

RoomModel = Literal['affine', 'quadratic', 'bounded', 'first_order'] module-attribute

How the barrier's room, the least h a plant within the deviation of a state can have, is read: affine, an h whose Hessian and third derivative are zero along the path, exactly; quadratic, one whose Hessian is one matrix there and whose third derivative is zero, less the curvature that matrix gives, exactly on a ball and a bound otherwise; bounded, less the caller's curvature, a bound wherever that is; first_order, an h that is neither, with no curvature given, to first order in the deviation only.

ModulusSource = Literal['supplied', 'measured'] module-attribute

Where PlanRegretBound.modulus comes from: the caller, or J's Hessian. Measured, it is the one Hessian of an objective the model's structure makes quadratic, which is the whole box's, or the least eigenvalue at the plan and at random points of the box, a sample that cannot bound the box's least; PlanRegretBound.status tells the two apart.

RegretStatus = Literal['certified', 'diagnostic', 'refused'] module-attribute

What PlanRegretBound.bound is. certified on a supplied modulus or a quadratic objective's; diagnostic on a sampled modulus, which a pocket of negative curvature between the samples breaks; refused, the bound inf, where the modulus came out negative or not a finite number, or the bound itself did not come out finite.

CausalPlan dataclass

A control sequence together with the certificate that says how far to trust it.

None in the certificate fields means no error model was supplied, which is a different statement from a certificate that came back empty: the first is "unknown", the second is "checked, and nothing holds". Earlier versions returned an all-zero tube and a full certified_horizon in the first case, which reads as a proof of safety over the whole plan when nothing was proved at all. Read certificate_status before either field.

solver_status answers a different question from certificate_status, and the two are independent. The certificate is about the model: how far the plan can be trusted given the error budget. The solver status is about the optimisation: whether the descent reached its own stopping rule or merely ran out of budget. A fully certified plan built on an unfinished solve is a trustworthy tube around a suboptimal action, and nothing in the tube says so.

shadow_prices answers a third: what each constraint row costs the plan, read off the problem the plan was solved for.

certificate_status property

Whether the tube was evaluated at all, and if so how much of the plan it covers (CertificateStatus).

Derived rather than stored: a status field that can disagree with the horizon it summarises is a worse footgun than the one this replaces. An infinite tolerance reads no_tolerance: up to 0.18.0 it read certified on every plan whose tube stayed finite, a pass no tube could fail.

stationarity_status property

How stationarity reads against stationarity_tolerance.

stationarity is the plan's KKT residual (ADR 0097). The descent steps in v = sigma * u (ADR 0059), where sigma_kj^2 is the cost's curvature along lever j at step k over |J| at the guess, zeros clipped to the box: a pure number in any units of the lever and the cost. There the gradient is read as a share of |J|, each row is divided by its norm, and the residual is the least norm of the gradient plus a push of the binding rows and box sides with the signs their bounds allow, over max(1, |gradient on the free actions|): zero exactly at a KKT point, positive where a multiplier has the wrong sign. Off the constraints its square is about twice the share of |J| that one more Newton step along each action alone would buy. What binds is shadow_prices' rule, read in v.

The tolerance is what the descent can see: it stops where no step buys more than max(1e-14, 4 eps) of |J|, eps the actions' precision, which leaves a residual of about the root of twice that; ten times it allows for a curvature off one along the residual. Where the curvature is further off, as under a steep penalty, the descent reads this residual itself and stops only within the tolerance, or where the gradients at the ends of every trial read no fall either. beyond it, the descent stopped on its budget or short of the optimum, and the plan, its prices and its regret are a stopped solve's. On a plan held under a barrier, each step whose condition the rounds ended with a positive multiplier on binds too, and pushes along the gradient of its shortfall in v: the residual is the augmented Lagrangian's, grad J + sum_k mu_k grad c_k with mu >= 0, read at the condition the rounds held, a relative 1e-6 inside the audit's. Under causal_plan(inner="orthant") an action on the condition's kink at the barrier's centre is read by the norm's subdifferential: its miss is the part of its push that the norm's slope does not absorb, and the residual is the smaller of that reading and the one above, each an upper bound on the least.

violation_status property

How constraint_violation reads against violation_tolerance.

constraint_violation is the largest distance in v, the variables of stationarity_status, from the plan to a side of its box or to a bound of one of its constraints rows that it is past: a row's excess over the row's norm in v. Zero where the plan meets every one. Its tolerance is the one the descent's projection holds each side and row to, 256 eps (1 + max|v|), times four for the plan's own rounding and a projection started from another guess. The barrier's condition is not among them: safety audits it.

certified_actions property

The prefix of the plan the tube still covers -- what a cautious caller should execute.

Raises:

Type Description
ValueError

if no error model was supplied. Slicing by None would hand back the whole sequence, and an empty one would claim the plan had been checked and failed; neither is true, so the question has no answer to return.

shadow_prices(tolerance=None)

What each row of the plan's constraints is worth: its KKT multiplier at this plan.

The gradient is of the objective the solve minimised -- the task cost, plus the pessimism penalties when a support model was given -- at the returned actions. A row binds within tolerance * (1 + |bound|) of its bound, and so does a box bound. The box's multipliers absorb every action at a bound, so the rows' multipliers solve the stationarity conditions on the free actions alone, by least squares. Where the binding rows are dependent there, the multiplier is not unique, and two linear programs give each row's range instead.

Read residual and dual_feasible before the prices. A solve stopped by its budget is not at a KKT point, and its prices answer a question that has none. A price is the marginal fall in the optimum per unit its row is relaxed: of the optimum, on a plan convex in its actions -- a linear model and a quadratic cost -- and of the local optimum the solve found otherwise. These are the stated rows' multipliers, not the barrier rounds' that chc.mpc.RecedingHorizon carries between steps.

Computed when asked: one gradient, a least-squares solve and, for a degenerate row, two linear programs. tolerance defaults to max(1e-6, 1e3 * eps) of the actions' dtype.

Raises:

Type Description
ValueError

on a plan held under a barrier, whose condition is a constraint of its own, with multipliers that would enter every row's price; or on a plan that carries no problem, as one built by hand does.

decision_weight(tolerance=None)

What an error in the one-step channel costs this plan, to second order. Experimental.

If the plant's one-step map is the planning model's plus E u, each entry of the channel off by E as chc.gate.channel_drift_evalues watches them, the plan loses vec(E)' W vec(E) / 2 against the plan that knew E, up to a term cubic in E. By the envelope theorem W = J_Eu M^-1 J_uE, with M the Hessian of the task cost in the directions the plan may move and J_uE its mixed derivative in those directions and E. The directions are the actions off the box, along the binding rows, with shadow_prices' rule for what binds. u is the action the field takes: a lever chc.decision.prescribe keeps on the log's rule of the state enters at its rule's level, not at its column of actions.

W is the regret's curvature at E = 0, and three things bound how far it reaches:

  • The active set. W holds while the bounds and rows that bind stay binding. At one met with a zero multiplier, counted in weakly_active, the regret is piecewise quadratic, and W, with the bound held, is its lower branch: freeing a direction can only raise it.
  • The cubic term. On the scalar plan of validation/plan_decision_weight.mac, whose one-step channel is 0.117, the regret's third derivative in E is -280 where W is 9.2, and the quadratic is within 10% of the exact regret only for E in [-0.0096, 0.0102], about 8% of the channel.
  • A stationary plan. residual is the stationarity miss along the free directions. A solve stopped by its budget carries a first-order term that W does not.

W vanishes where the plan's response to the channel is flat, as on one step at r = gamma^2 qf, and the regret there is fourth order, not nil.

Computed when asked, in the plan's precision: one Hessian of the task cost in the actions, (H m)^2 entries, and one mixed derivative. tolerance is shadow_prices'.

Raises:

Type Description
ValueError

on a plan held under a barrier, whose condition moves with the channel; on one solved with pessimism penalties, whose regret on the task cost has a first-order term; on one that carries no problem, as one built by hand does; or where M is not positive definite, so the plan is not a strict local minimum and its regret is not quadratic in E; or where the task cost's derivatives at the plan are not finite.

planned_cost_bias(covariance, *, error_mean=None, tolerance=None)

How far the plan's own cost reads from what it costs the plant, in expectation over the estimate's error, and the cost corrected for it. Experimental.

The plan was made on an estimate of its one-step channel, off the plant's by e with covariance = S = E[e e'], e the estimate less the plant's channel, raveled as decision_weight ravels it. Its planned cost, the task cost on the estimate, misses what the plan pays on the plant by

E[J_true - J_model] = tr(W S) - tr(J_ee S) / 2 - J_e . E[e]

to second order (validation/planned_cost_bias.mac), with W the decision weight, J_ee the task cost's Hessian in the channel at the fixed plan and J_e its gradient. The first term is the optimiser's curse and is never negative: the plan fits its estimate's error. The second is the curvature of the planned cost at the fixed plan, never positive where that cost is convex in the channel. So the sum has no fixed sign. On one step of x1 = a x0 + b u at the cost q x1^2 + r u^2 it is a^2 q^2 x0^2 (2 r^2 - 5 b^2 q r + b^4 q^2) / (r + b^2 q)^3 per unit of S, which is negative, a planned cost that reads high, for q b^2 / r between (5 - sqrt 17)/2 = 0.438 and (5 + sqrt 17)/2 = 4.562, and positive outside. The third term is the estimate's own bias, error_mean, 0 where it is not given; a cross-fitted channel's is of the order of S.

Each term is read at the plan and the estimate, not at the plant's channel, which the expansion is about: the difference is of higher order. It holds while the plan's active set does not move with the error, so a plan that meets a bound or a row with a zero multiplier is refused; and as far as W does, for an error small against the channel (see decision_weight). residual is the stationarity miss along the free directions: a solve stopped by its budget carries a first-order term that W does not.

chc.misspecification.planned_cost_bias reads S off a fitted channel's influence, over every parameter the fit holds, the drift's included.

Raises:

Type Description
ValueError

on a covariance that is missing, not a finite (n m, n m) matrix, or not symmetric positive semidefinite; an error_mean that is not a finite (n, m) matrix; a plan that meets a bound or a row with a zero multiplier; and whatever decision_weight refuses.

RowPrice dataclass

What one constraint row is worth to the plan: how much its objective falls per unit the row is relaxed -- an upper bound raised, a lower bound lowered.

status says how far price can be read:

  • exact -- the row binds, and the binding rows are independent on the actions the box leaves free (LICQ), so the multiplier is unique.
  • weakly_active -- the row sits at its bound with a multiplier of zero: relaxing it buys nothing to first order, and tightening it costs nothing to first order.
  • degenerate -- the binding rows are dependent on the free actions, so the multiplier is a set: price is None and interval its range. Relaxing the bound buys interval[0] a unit and tightening it costs interval[1], both widened by the stationarity slack.
  • inactive -- the row has room, and is worth nothing at the margin.

An equality row's price takes either sign: the fall per unit its value rises.

ShadowPrices dataclass

The rows' prices at a plan, with what it takes to trust them.

See CausalPlan.shadow_prices.

DecisionWeight dataclass

What an error in the one-step channel costs a plan, to second order. Experimental.

See CausalPlan.decision_weight.

regret(change)

vec(E)' W vec(E) / 2 at change = E: what the plan loses, to second order, against the plan that knew its one-step channel was off by E.

Raises:

Type Description
ValueError

on a change that is not a finite channel_shape matrix.

PlannedCostBias dataclass

A plan's planned cost, its bias against what the plan pays the plant, with its sign, and the cost corrected for it, to second order in the estimate's error. Experimental.

See CausalPlan.planned_cost_bias.

bias property

E[J_true - J_model]: what the plan pays the plant less what it reads, in expectation; positive where the planned cost reads low.

corrected_cost property

The planned cost plus its bias: what the plan pays the plant, in expectation.

direction property

Which way the planned cost reads (CostBiasDirection). A nan bias, as from a term a plan that left the float range reads, is unknown: up to 0.18.0 it read unbiased, failing both comparisons.

ChannelSensitivity dataclass

An absolute radius on a fitted channel's error, state by state, under a marginal sensitivity model of level Gamma on the levers given a hidden confounder.

The model: given the state and the adjustment set, a hidden confounder Z moves the levers' density by a factor within [1/Gamma, Gamma] (the continuous marginal sensitivity model, Jesson et al. 2022), and nothing bounds how much of the rate's noise Z carries. The factor's lower side alone splits the joint law of the levers and Z into 1/Gamma of the product of their two laws and 1 - 1/Gamma of a law with the same two marginals, so no function of the levers correlates with one of Z beyond 1 - 1/Gamma (their maximal correlation, Rényi 1959), and the share of an action residual's variance Z explains is at most rho^2 = (1 - 1/Gamma)^2. The share is sharp: a lever of two values that takes the confounder's sign with probability 1 - 1/(2 Gamma) reaches it. The bound reads Gamma only through rho, so a lever whose maximal correlation with the confounder is rho reads as Gamma = 1/(1 - rho): a Gaussian one, whose density ratio no finite level bounds, as 1/(1 - sqrt(R^2)), R^2 the share of its action residual the confounder explains. The least-squares channel on the action residuals is then biased by at most

``||(B_hat(x) - B(x)) D||_2 <= kappa(Gamma) * confounding * nu(x)``,
``kappa(Gamma) = (Gamma-1) / sqrt(2 Gamma - 1)``,

at every state x (validation/channel_bias_bound.mac), where confounding is sqrt(lambda_max(R'R)), R the fit's moment residual, and nu(x)^2 = lambda_max(D Phi(x)' V^-1 Phi(x) D), V the channel's design on the action residuals gram, Phi(x) a the design row of an action a at x and D each lever's largest action over the largest (certify_safety's u_max). The bound is finite at every finite level and grows as sqrt(Gamma / 2): a share 1/Gamma of the levers' law does not read the confounder, so at no finite level are they a function of it, and the bound is met, not only approached, by the two-valued lever with all the rate's noise from Z. Up to 0.21 the share was (Gamma-1)^2/Gamma, Gamma times this one, read off each value of Z alone, so kappa was wider by 1.05 to 4.0 at Gamma 1.1 to 2.5 and every level from (3 + sqrt 5)/2 on was refused. Beside the bias the channel scatters by sampling * nu(x), sampling the norm of chc.dynamics_id.channel_region's radii at level. The radius at x is

``Delta(x, Gamma) = nu(x) * (sampling + kappa(Gamma) * confounding)``,

in the channel's own units, an operator-norm ball around the estimate whose width reads the data: the scatter of the log's actions and of its noise, and how far x lies from the states the log moved the levers at. Gamma = 1 is the sampling error alone. Read at each planned step's predicted state, it widens where the plan leaves the log behind.

Premises: the fit's channel is least squares on the action residuals (an identified Euler fit by adjustment, as chc.dynamics_id.channel_region takes); the confounder's push on the rate is independent of the rest of its noise. The bound holds for any distribution of the actions; the sampling part is the ellipsoid's, whose noise must be mean zero given the actions, and under a confounder is read at the least-squares limit, to first order. An rk4 fit is not covered: its fixed point carries the drift's confounding, which no bound on the levers limits, into the channel.

from_fit(fit, level=0.95) classmethod

The fit's own: its channel's design, its moment residual and its region at level.

Raises:

Type Description
ValueError

where chc.dynamics_id.channel_region refuses the fit.

factor(gamma) staticmethod

kappa(Gamma) = (Gamma-1)/sqrt(2 Gamma - 1): the bias per unit of confounding * nu(x), finite at every finite Gamma; inf at inf.

Raises:

Type Description
ValueError

on a gamma below 1 or not a number, which is no sensitivity level.

level_at(factor) staticmethod

The Gamma whose factor is factor, 1 + k^2 + k sqrt(1 + k^2): 1 at 0, and inf where it passes the float range.

radius(state, gamma, u_max=None)

Delta(x, Gamma) at state, the levers read in units of their own largest action where u_max gives one per lever, as certify_safety reads them.

BarrierConstraint dataclass

grad h . xdot >= -alpha * h at every planned step, against every effect the data allow.

The condition certify_safety audits, handed to causal_plan to hold in the solve rather than to price after it. barrier is h -- safe where h >= 0, a JAX-traceable scalar function; alpha is the class-K gain; gamma and cvar_gap set the identification radius (gamma-1)/(gamma+1) * cvar_gap * ||B_hat(x0)||_2 on the effect, cvar_gap a share of the channel's operator norm at the plan's start, so the condition is the worst case over the identified set and gamma = 1 is the ordinary CBF condition. The defaults and the calibration burden on cvar_gap are certify_safety's.

Several bounds are a tuple of barriers, safe where every one is >= 0, and each holds its own condition at every step. Their least is no substitute: its condition jumps where two tie, reading on each side that side's gradient, so a solve that ends on the tie cannot step off it, and the condition it holds asks nothing of a bound until that bound is the nearest.

u_max, one number per lever, each lever's largest action in its own units, reads the condition in units of each lever's own largest action, as certify_safety does with the same numbers, and the audit after the solve reads them; None reads it in the levers' own units, one ball for all of them, as before. chc.prescribe passes its box's. A lever whose number is 0 must have a box that holds it at 0.

sensitivity (ChannelSensitivity) replaces the radius's share of the channel by an absolute radius at each step's predicted state, as certify_safety reads it, held in the solve at the same steps. chc.prescribe passes its fit's own where the fit gives one (ADR 0125).

u_box, (u_lo, u_hi) with one number per lever, is the box the audit after the solve reads gamma_star on; None reads it on the box the plan is solved in. A solve in a narrower box than the levers have -- chc.prescribe's lever selection pins the levers it leaves out at zero -- is then audited as if planned on all of them, with the same box as u_max.

centre, one number per lever, is the action the channel's error is read from, as certify_safety reads it, u_max then each lever's largest distance from it; None reads it from zero. chc.prescribe passes the log's mean action (ADR 0132).

curvature bounds how far each barrier bends down within the deviation of the path, as certify_safety reads it; None reads it from the barrier where that is affine or quadratic (RoomModel), at the path the solve starts from.

drift_error (experimental) bounds the drift's error, as certify_safety reads it: the deviation the held next states are read less widens by what it opens. None reads the channel's error alone, as up to 1.2. chc.prescribe passes its fit's under barrier_drift_error.

Raises:

Type Description
ValueError

on a gamma below 1 or not finite, which is not a sensitivity level, a cvar_gap not positive or not finite, which scales no radius, a u_max with an entry negative or nan, or none positive, which is no action's size, a centre with an entry not a finite number, which is no action, a curvature negative or not finite, which bounds no bend, a drift_error negative or not finite, which bounds no error, or an empty tuple of barriers, which holds nothing -- here, rather than after the solve that would have used them.

SafetyCertificate dataclass

The robust barrier check along a finished plan: how much confounding its guarantee survives.

Two questions that must not be conflated, so both are reported:

  • planned_certified -- does the action the planner actually chose still clear the barrier once the adversary moves the effect inside the identified set? This is about this plan.
  • gamma_star -- does any admissible action clear it, and up to which sensitivity level? This is about the problem, and is the number an operator can act on. A plan can fail the first while the second is comfortable, which says the planner, not the confounding, is at fault; the reverse says no controller would have helped.

So gamma_star = inf beside few or no certified steps is no contradiction: where the drift alone holds every step, or the radius has no part a level widens (a sensitivity with no confounding), the ceiling is inf, while a certified step needs this plan's own action to clear the condition and its path, widened by deviation, to stay in the set.

PlanRegretBound dataclass

How far a finished plan can be from the best one the same box allows.

The self-certifying bound J(U) - J* <= |grad J|^2/(2 mu) (chc.research.regret.finite_horizon_pl_certificate) needs no optimum, which is what makes it a certificate rather than a diagnostic. It does not survive a box: at a lever the gradient holds against its own bound grad J is nonzero while the true regret is zero, so that bound charges regret to a coordinate that cannot move. chc.research.regret.constrained_ce_regret_certificate reads the same fact from the other side -- an active cap freezes the control and the regret's curvature collapses.

What replaces it is the same quantity maximised over the feasible moves only. Per coordinate the certified gain of a move d is -g d - (mu/2) d^2, and its maximum over [lo - U, hi - U] is the unconstrained one minus a perfect square (validation/constrained_plan_regret.mac STEP 3a): never larger, exactly zero at a lever the gradient pins, and still finite as mu -> 0, where it degrades to frank_wolfe_gap rather than to infinity.

The moves are measured lever by lever, each in its own scale (STEP 8 of the same file): the modulus is the curvature in the norm |D^-1 d|, D one scale per lever that moves with that lever's units, and a move's curvature along lever j is mu / s_j^2. In the plain norm the modulus is the cheapest lever's curvature, which charges a stiff lever's moves at a cheap one's, and the bound read the levers' units: lever u1 in units 1e3 times its own took one plan's bound from 0.0266 to 0.0576, where it now reads 0.0214 in both. Measured, the scales come from the Hessian's diagonal (_objective_modulus); a supplied modulus is the plain norm's, every scale 1.

The bound is on the planning objective, which is the question the solver was asked. How far the planning model itself is from the plant is the error tube's question (CausalPlan.uncertainty_tube), and the two must not be added.

It is a certificate only where the modulus is one for the whole box: supplied, or read off an objective the model's structure makes quadratic (status). A modulus sampled at the plan and a few points of the box is not: a pocket of negative curvature between the samples can hide a plan much cheaper than this one, and the bound then reads small with nothing behind it.

causal_plan(model, x0, cost, dt, horizon, u_lo, u_hi, *, support=None, lam_supp=0.0, uncertainty=None, lam_unc=0.0, lipschitz=0.0, model_error=0.0, noise=0.0, noise_persistence=0.0, tolerance=_TOLERANCE_DEFAULT, steps=10000, constraints=(), barrier=None, warm_start=None, inner='diagonal', outer='halved')

Plan under box constraints, optional offline pessimism, and a certified error tube.

Parameters:

Name Type Description Default
support SupportModel | None

offline (x, u) support model; supplying it switches the solve from plain projected-gradient OC to chc.support.pessimistic_control.

None
uncertainty PenaltyModel | None

a PenaltyModel (ensemble, Wasserstein, confounding radius) weighted by lam_unc. Requires support -- the pessimistic solver evaluates both terms.

None
lipschitz, model_error

feed the error tube of the plan's RK4 rollout, the field off by at most model_error wherever a step reads it. lipschitz is either a norm-Lipschitz bound L >= 0 on the field in the state, for the recursion e_{k+1} = e_k + dt (L e_k + eps) phi(L dt), phi(z) = 1 + z/2 + z^2/6 + z^3/24 (chc.uncertainty.time_varying_rollout_bound), or, for a field affine in the state, its (n, n) state matrix A, whose RK4 propagators carry the tube (chc.uncertainty.linear_rollout_bound) and shrink it where A contracts. model_error or noise is what switches certification on: with neither the tube would be identically zero, so the plan reports certificate_status == "not_evaluated" and both certificate fields come back None rather than a vacuous full-horizon pass.

required
noise, noise_persistence

the plant's own error at each step, which no model error covers: w_k = x_{k+1} - step(x_k, u_k), the plant's next state less the plan's RK4 step of the model from the plant's state, Gaussian, AR(1) from one step to the next, Cov(w_i, w_j) = noise_persistence^|i - j| noise. noise is its covariance in the state's units, a number for each state's variance with none shared, or an (n, n) matrix; noise_persistence its lag-1 correlation, in [-1, 1], or the (n, n) coefficient Phi of a VAR(1), w_{k+1} = Phi w_k + eta, where the states' noises persist at rates of their own, Cov(w_{k+1}, w_k) = Phi noise, a stationary noise's, noise - Phi noise Phi' with no negative eigenvalue. The tube adds to the model error's radius the one within which the noise's part of the gap stays at each step with probability 0.95, carried through the same lipschitz: through R(dt A) on a state matrix, exactly to first order, and on a norm bound L through R(L dt), which bounds it (validation/predictive_tube.mac). On a state matrix the gap's covariance is exact, and the radius is the exact 0.95 quantile of the gap's distance from the plan, a sum of the covariance's eigenvalues times independent chi2_1 (Imhof 1961). On a norm bound it is that quantile at the first step, where the covariance is noise itself, and past it sqrt(chi2_n(0.95)) times the root of the bound on the largest variance along any direction, which holds with probability 0.95 on one state and more on several. Up to 0.17.0 that was the radius on a state matrix too, up to sqrt(chi2_n(0.95) / chi2_1(0.95)) too wide where one direction's variance dominates, 1.249 times on two states. Zero by default, which leaves the tube the model error's alone, as before.

required
tolerance float

tube radius above which the plan stops being certified, in the state's units. A step whose predicted state is not a finite number, an overflow's or a nan's, is certified at no tolerance. The default, 1.0, is one unit of the state, the radius ADR 0091 asks of a caller who logs each state in units of the error accepted on it. inf holds every finite radius, and the plan's certificate_status then reads no_tolerance rather than certified. Up to 0.19 the default was inf.

_TOLERANCE_DEFAULT
constraints Sequence[LinearConstraint]

linear rows over the whole action sequence (LinearConstraint), held by every iterate of either solver, not only by the answer.

()
barrier BarrierConstraint | None

a condition to hold at every planned step (BarrierConstraint), or one per barrier of a tuple, by augmented-Lagrangian rounds around the same descent, with h >= 0 at each step's next state where the path would leave the set, as the audit certifies a step by. Unlike constraints it binds the answer, not every iterate, and the plan comes back with CausalPlan.safety -- certify_safety run on the finished plan, the verdict to read. Its gamma_star is priced at the largest magnitude any lever may take, the budget chc.prescribe uses, drawn back to the box where the best action of that size leaves it. A barrier the unconstrained plan already clears changes no action, even when that solve stopped on its budget. steps then caps the descent before the rounds, and the rounds' descents on each set of next states they hold together, so a held plan takes at most twice steps, and steps more for each time a next state joins the held ones, besides the plan on the concave envelope it may start from; it used to cap each of up to 31 descents. The solver status reads converged only where the rounds hold the condition and the plan's stationarity_status reads within; infeasible where the rounds' penalty reached its ceiling with some step still short of the condition after a round that stopped on its own rule, at a plan whose stationarity is within its tolerance as well, and no_progress where that plan's is not: a stall of the rounds, not a sign of the condition.

None
warm_start Array | None

the (horizon, m) actions the descent starts from, zeros when omitted -- typically the last plan shifted one step, which chc.mpc.RecedingHorizon passes along with the barrier's multipliers. It is projected onto the box and the rows before the first step, so it need not be admissible. It moves where the solve starts, and so what a solve stopped by steps returns; a solve that converges on a problem with one minimiser lands on it from any start. Omitted on a model holding a chc.response.Saturation that starts convex, the start is instead the plan of the same problem on each such curve's concave envelope (chc.response.relax), and the plan reports that problem's cost as CausalPlan.relaxed_cost: such a curve has no slope at zero spend, so zeros are a stationary point the descent would stop at, reporting convergence.

None
inner InnerSolve

how each of a barrier's rounds is solved (experimental). "diagonal", the default, is the descent in the round's diagonal Gauss-Newton metric. "newton" is Bertsekas' projected Newton method on the box (1982), on a dense matrix over the actions: the cost's Gauss-Newton matrix, its second derivative along the rollout's first-order answer to the actions, plus the penalty's Hessian on the steps whose term is on, or, where that is not positive definite on the actions off the box, the penalty's Gauss-Newton part, which with the cost's has the square of that metric for its diagonal. A diagonal metric does not solve a round the penalty has made ill-conditioned, and its rounds can spend steps with the plan's stationarity_status beyond; Newton's do not stall there while the round is smooth. A held condition's worst case, a + <w, u> - d ||D^+ (u - c)||, has a kink at the barrier's centre c (zero where it is None), and a plan that comes to rest there stalls under either solve: on the plans chc.decision.prescribe holds, whose centre is the log's mean action, Newton, like the diagonal descent, can end max_iterations with stationarity beyond. A Newton step whose block of the matrix does not factor, or that buys no fall, hands the round to the descent. "orthant" is Newton's method with that kink taken by its sides, at each step with one lever under a radius: the action's box is cut at c on the side the action is on, where the norm is linear; an action at c leaves it only toward a side where the round's other terms fall faster than the norm's term rises; and the plan's first-order check reads it by the norm's subdifferential. On an unstable drift held under a ChannelSensitivity, three logs of 30 steps on which SLSQP's plan rests 27 to 29 actions at zero, it ends converged within 1e-7 of SLSQP's cost, certified on all 30 steps, where the default rounds end max_iterations 0.17 % to 1.5 % above it. With several levers a step, or no radius, it steps as "newton" does. It is not the default because it is not better plan by plan: of 227 plans held at a barrier in the library's planning tests it left 36 within 1e-9, made 90 cheaper at the same certified steps, certified 6 on more leading steps and none on fewer, and ended 67 converged that ended max_iterations; but it made 95 costlier at the same certified steps, 93 that end converged by at most 7.5e-7 and two plans of the oscillator held at a budget of 10 steps by 5.4 %. Both take the box alone, and factor an (H m, H m) matrix at each step: a support model, linear rows, or more than 4096 actions are refused. Without a barrier there are no rounds, and either changes nothing.

'diagonal'
outer OuterRule

how a barrier's rounds share steps and grow their penalty (experimental, OuterRule). "halved", the default, gives each round half of the steps left, and a round whose share ran out grows no penalty. "safeguarded" gives each round 333 steps, runs rounds until steps are spent, 30 more than its full shares at most, and grows the penalty tenfold after every round whose measure fails to halve, its share run out or not, Birgin & Martinez's rule (2014) as they state it. Where every round runs out of its share, the halved rule never moves the penalty: on an unstable drift held under a ChannelSensitivity it stayed at its start over all 15 rounds, where the safeguarded rule grew it seven or eight times, as the rounding of the path goes (ADR 0156). Where next states join after a set of its rounds, the projection onto the held columns there is kept as a candidate plan (ADR 0169). It is not the default because it is not better plan by plan: of 293 plans held at a barrier in the library's planning tests it moved 148, 46 to a cheaper plan at the same certified steps, 67 to a costlier one (by up to 43 %), 7 within 1e-9, 13 to more certified leading steps and 15 to fewer, two of them from 12 to 8 where the halved rounds certified all 12; 18 plans that converged under the halved rule ended max_iterations, and 8 that ended max_iterations stalled at the penalty's ceiling, no_progress. Without a barrier there are no rounds, and it changes nothing.

'halved'

Raises:

Type Description
ValueError

if an uncertainty penalty is given without a support model, which would silently drop it -- the pessimistic solver is the only consumer of that argument; if model_error is negative, infinite or nan, which is not an error budget; if lipschitz is a negative, infinite or nan number, which no norm of a field's slope is, or neither a number nor a square matrix of the state's size; if noise is not finite, not a number or a matrix of the state's size, or not a covariance, which is symmetric with no negative eigenvalue, or noise_persistence is neither a correlation in [-1, 1] nor such a VAR(1) coefficient; if tolerance is negative or nan, or dt is not a finite positive step; if x0 has an entry that is not a finite number, from which no step is predicted; if a barrier is given with a box that admits no action but zero, which leaves nothing to price it with; if a barrier is given and the path from the descent's start or from the rounds' start is not a finite number at some state, or the model is not affine in the action there or at a finite side of the box, which certify_safety refuses of the finished plan and is now refused before the solve; if warm_start is not a finite (horizon, m) array; or if inner is none of "diagonal", "newton" and "orthant", or is one of the last two beside a barrier and a support model, linear rows, or more than 4096 actions.

certify_safety(plan, model, barrier, dt, *, alpha=1.0, gamma=1.0, cvar_gap=1.0, u_max=None, sensitivity=None, centre=None, curvature=None, drift_error=None)

Price a plan's barrier guarantee against a partially identified control effect.

The plan was made under a point estimate of the effect. If that estimate came from confounded logs the effect matrix is only set-identified, and given an operator-norm identification radius ||B_hat - B||_op <= Delta the channel w = B^T grad h is pinned within d = Delta * ||grad h||, so the guaranteed barrier derivative at action u drops to a + <w, u> - d*||u - c|| (chc.barrier), c the action the drift was fitted at (centre). This walks the nominal trajectory and reports where that guarantee survives.

Parameters:

Name Type Description Default
barrier Barrier

h(x), safe where h >= 0. Differentiated with jax.grad, so it must be a JAX-traceable scalar function. A tuple of them is audited each on its own and read as one: a step is certified where every barrier's condition holds there, and the step's barrier_values are the least barrier's, its guaranteed_derivative and required the pair of the barrier with the least room, and its step_gamma_star the least of theirs -- an upper bound rather than the step's own ceiling, since each is reached by its own best action and no one action need reach the least.

required
alpha float

the class-K gain in grad h . xdot >= -alpha*h.

1.0
gamma, cvar_gap

the marginal sensitivity model's level and the gap its factor scales, combined into Delta = (gamma-1)/(gamma+1) * cvar_gap * ||B_hat(x0)||_2: cvar_gap is a share of the model's channel, its operator norm at the plan's first state, so the radius is in the channel's units and gamma_star reads the same in any units of the state or of the levers. The default, 1, is the channel's own size, the calibration cvar_gap := b_hat of chc.research.sensitivity. gamma = 1 is exact identification -- zero radius, and this degenerates to the ordinary CBF check. NOTE the calibration burden: Delta is used here as an operator-norm radius on the effect matrix, and the sensitivity model's scalar CVaR gap does not by itself establish one. The share is the caller's externally calibrated input, exactly as gamma is; an absolute radius r is the share r / ||B_hat(x0)||_2. The radius is a share of the fitted channel, so at every gamma, however large, it stays within cvar_gap * ||B_hat(x0)||_2 of the estimate: gamma_star = inf reads every level of that set, and nothing of an effect further off. With the default share an estimate of 0.004 for an effect of 1 is certified at every level along a plan the effect itself takes out of the set. The factor (gamma-1)/(gamma+1) is the bounded-density-ratio model's (chc.uncertainty.confounding_robust_inflation), but a channel radius spent as d*||u|| is a structural sensitivity model of its own, not that model's bound. Read so, gamma and gamma_star are a relative margin, not a level of confounding; sensitivity gives the radius a sensitivity model's meaning.

required
u_max ArrayLike | None

actuation limit, used for gamma_star -- that is the best admissible action question, which needs a budget the plan's own choice does not define. Defaults to the largest action norm the plan actually uses, answering the narrower "how much confounding does this plan's own authority tolerate". One number per lever, each lever's largest action in its own units, reads the whole audit in units of each lever's own largest action: the action set is the ellipsoid ||D^+ u|| <= U whose semi-axes are those numbers, U the largest and D each over U, the radius Delta is on (B_hat - B) D and sized by ||B_hat(x0) D||_2, and an action's norm is ||D^+ u||. That reads the same in any units of each lever, where one number reads the levers' units as one: on a log of one state and two levers in [-2, 2], either lever logged in units 1e3 or 1e-3 times its own, its box with it, the barrier's certified steps fell from 3 to 0. One lever, or levers whose numbers are equal, read the ball of radius U they read with u_max = U, bit for bit. A lever whose number is 0 has no action in the set, and the plan must not move it. A number inf, a free side's, leaves no units to read that lever by, and the audit reads the levers' own units, as u_max = inf does. The set is symmetric about centre: where the levers' box is not, it admits actions the box does not, and gamma_star read on it can name a level no admissible action holds. causal_plan and chc.prescribe read it on their box as well.

None
sensitivity ChannelSensitivity | None

an absolute sensitivity model of the channel (ChannelSensitivity), in place of cvar_gap's share: the radius at step k is Delta(x_k, gamma) = nu(x_k) (sampling + kappa(gamma) confounding), read at the step's predicted state, a bound on the channel's error there when the levers' density given a hidden confounder moves by a factor within [1/gamma, gamma], at the sensitivity's level. gamma = 1 is then the sampling error alone, not exact identification, and gamma_star is each step's largest gamma under that model: finite, or inf where the drift alone keeps the step. Without drift_error what it certifies is a plant with the model's drift and a channel within the radius: on 20 logs whose levers follow a confounder at gamma = 1.5, of a stable drift and of an unstable one, a plan held and certified under the fit's own sensitivity at that level kept the plant with the true channel, and those at both edges of the radius, in the set over its certified steps on every log (ADR 0119). The true plant also misses the fitted drift, by the fit's sampling error, drift_error 0.094 to 0.098 on the unstable drift's logs and the largest miss 1.7 of it, which the radius does not carry: it stayed in the set on all 20 stable logs, and on the unstable drift left it on 1 of 20, least h -0.09. That error is then the error tube's, causal_plan's model_error (ADR 0111), or the room's under drift_error, below, with which the true plant stayed in the set on all 40 logs. The certificate's radius_model reads "absolute" with a sensitivity and "relative" without one. chc.prescribe passes its fit's own by default, where the fit gives one (ADR 0125).

None
centre ArrayLike | None

the action, one number per lever, every action is read from: the channel's error moves the field by an action's distance from it, and the action set, u_max and an action's norm are measured from it, ||D^+ (u - c)||. A fit regresses the drift on the log's actions, so its drift holds the channel at the log's mean action, and there the field's error is the drift's alone (ADR 0091): pass that mean, and the audit reads the same wherever a lever's zero is (validation/barrier_centred.mac). None reads every action from zero, as up to 0.21, which a fit's drift does not hold: on a log of one state and two levers, u1's zero moved by 100, its log and box with it, read gamma_star 1.04 and certified no step of three where it read inf and certified three. chc.prescribe passes the log's mean action (ADR 0132).

None
curvature float | None

kappa, a bound on lambda_max(-grad^2 h) at every point within the deviation of the plan's path: how far h bends down there, so the room at a state e from it is read as h - ||grad h|| e - kappa e^2 / 2, at most the least h a plant there can have. None reads it from h: 0 on an affine h, and the largest eigenvalue of -grad^2 h on a quadratic one, whose Hessian is one matrix; on any other h the room is then read as on an affine one, to first order in e only. The certificate's room_model says which (RoomModel). On a disk 1 - ||x||^2 the room read to first order was e^2 above the least h: a step whose plant could reach h = -0.10 was certified (ADR 0132).

None
drift_error float | None

experimental: a bound on the drift's error, how far the plant's field at the centre may be from the model's at every state the plan reaches, in the rate's units and the Euclidean norm over the states. The deviation tube carries it beside the channel's radius, a constant added to the field at every stage as the channel's error is, e_{k+1} = ||dF/dx|| e_k + ||dF/dc|| (Delta_k ||D^+ (u_k - c)|| + drift_error) (validation/barrier_deviation_tube.mac (5)), so a certified step also holds a plant whose drift is within it of the model's: exactly where the model is affine in the state and the drift's error does not move with it, to first order in the tube's width where it does. The condition, and gamma_star with it, still read the model's drift: the error reaches the certificate through the room alone. A fit's drift_error is a standard error, a root mean over the log's rows and its states; chc.prescribe passes t sqrt(n) times it under barrier_drift_error, t Student's at 0.975 and n the states, which reads it at the log's rows, not at the plan's states: at the held plans' states of two of the logs below, inside the log's spread, the drift's own standard error was 0.71 to 0.85 of the root mean (scripts/bench_drift_room.py, section reach), and beyond the spread 1.45 to 1.63 times it (ADR 0104), so a plan that leaves the log meets a larger error than the bound. On the 20 unstable logs above, each plan held and certified under the fit's own sensitivity at gamma = 1.5 and that bound (0.185 to 0.192), the true plant stayed in the set over the certified steps on every log, least h +0.72, where without it it left on 1. The price is the certified steps on the unstable drift: 24.85 of 30 on average, where they were 29.95; by log 28, 25, 19, 22, 22, 20, 28, 26, 25, 26, 23, 22, 26, 24, 29, 28, 25, 21, 30 and 28, where they were 30 but on one log 29; 5 plans end infeasible, and the cost is 5.7 % higher on average. On the stable drift (-1) every plan was certified on all 30 steps either way, its cost 0.43 % higher on average. On 200 unstable logs, seeds 0 to 199, the true plant stayed in the set over the certified steps on all 200 with the bound and on 173 without it, 0.865, below the 0.95 the channel's radius states: without the bound the certificate does not carry the drift's sampling error, a calibration gap of the default. None, the default, reads the channel's error alone, as up to 1.2, and stays so in 1.x: the bound shortens the certified steps there, 29.2 to 24.6 on average (ADR 0119, amended; scripts/bench_drift_room.py).

None

Assumes the plant is control-affine, and checks it: the condition reads the drift and the channel at zero action, so a model whose field, seen through grad h, is not affine in the action at the planned actions or at those gamma_star reads is refused. Assumes the uncertainty set isotropic (see chc.barrier; d*||u|| is exact for a Euclidean ball, an outer bound otherwise).

What a certified step promises: every plant whose channel is within the radius of the model's, its drift the model's, stepped by the model's one-step map under the plan's own actions from the plan's start, is in the safe set at that step's state and the next. The condition is read at the model's states, and such a plant's path leaves them: under an exact absolute radius of 0.1004 on a drift of 0.3, a plan certified on all 60 steps by the condition alone took the plant at the radius's edge to h = -0.132, and on an integrator at dt = 1 one certified on all 12 took it to h = -0.5. So a step is certified where the condition holds at its state and h - ||grad h|| e - kappa e^2 / 2 >= 0 at its state and at the next, kappa the barrier's curvature and e the deviation tube e_{k+1} = ||dF/dx|| e_k + ||dF/dc|| Delta_k ||D^+ (u_k - c)|| that the channel's radius can open between the two paths (deviation, validation/barrier_deviation_tube.mac), F the one-step map, c an error added to the field. The tube bounds the gap where the model is affine in the state and the channel's error does not move with the state (a relative radius, or a sensitivity of channel_degree 0); elsewhere it reads the map's slope and the radius at the model's states, and holds to first order in its own width, whatever room_model says of h. Without drift_error it is about the channel alone: an error in the drift is outside it. With it, a plant whose drift is within drift_error of the model's is inside it, and the tube's push reads that bound too. A plant stepped by another map than the model's is outside it either way. Reading h at both ends of a step also catches a path that leaves the set between the points the condition is read at: at dt = 1 and alpha = 1 a plan that met it at every step of twelve ended outside the set. Between the steps nothing is read.

Raises:

Type Description
ValueError

if cvar_gap is not positive or not finite, which would make the radius meaningless and chc.barrier.barrier_gamma_star uninvertible, or the channel at the plan's first state is not a finite number; if gamma is below 1 or not finite, which is not a sensitivity level; if the actuation budget backing gamma_star is non-positive, which asks how much confounding a controller with no authority tolerates; if u_max per lever has an entry negative or nan, none positive, not one per lever, or a 0 at a lever the plan moves from centre; if centre is not a finite number per lever; if curvature or drift_error is negative or not finite; if a state of the plan's predicted path is not a finite number; if the model is not affine in the action where the condition is read; or, with a sensitivity, if the sensitivity's channel has another size.

plan_regret_bound(plan, model, x0, cost, dt, u_lo, u_hi, *, modulus=None, probes=16, seed=0, constraints=())

The optimality gap of a finished plan, certified from its own gradient.

Derived in validation/constrained_plan_regret.mac, proved in proofs/constrained_plan_regret.v. Reads the plan's actions, not the solver's internals, so it prices a plan that came from anywhere -- including one an operator edited by hand.

The feasible set is the box, and the linear rows passed as constraints. Without them the bound is on the gap to the box's optimum, which is never below the gap to the optimum under the rows the plan was solved under, so it stays valid and is loose by what the rows cost: a plan at the exact optimum under a budget row that binds read 0.0885 where its own gap is zero. Passed the rows, it reads 4e-13 there.

Parameters:

Name Type Description Default
modulus float | None

the strong-convexity modulus of J over the box, which makes the bound a certificate. None reads it off J's Hessian (see _objective_modulus): once at the plan where the model is linear, the Hessian then being one matrix, and otherwise at the plan and probes random points, a sample that cannot certify. A smaller modulus gives a larger bound and is never invalid (STEP 4d), so a conservative one is the safe input; for a linear plant with positive semidefinite Q and Qf, lambda_min(R) is always valid and needs no eigenvalue solve on J. A supplied modulus is the plain norm's, in the levers' own units, and the bound then reads those units; read off the Hessian, each lever's moves are in its own scale.

None
probes int

random feasible points added to the curvature sample when modulus is sampled.

16
constraints Sequence[LinearConstraint]

linear rows over the whole action sequence (LinearConstraint) that bound the plans compared with this one, beside the box. The certified gain over the box and the rows has no closed form; it is read off its Lagrange dual, q(lam) = sum_i max_{d_i in box} (-(g + G'lam)_i d_i - c_i d_i^2 / 2) + lam'(b - G U), at the multipliers a dual descent ends on, and any multipliers bound it from above (weak duality, validation/regret_bound_rows.mac), so the descent's stopping point loosens the bound and never voids it. The modulus and its sample still read the box alone. frank_wolfe_gap is the linear program over the same set, read off its dual too, and per_lever the gain of each lever's moves at the dual's maximiser, which sums to bound less the multipliers' slack in the rows.

()

The three numbers to read together: bound is what the box certifies, unconstrained_bound is what the unconstrained bound reports at the same plan, and frank_wolfe_gap is what survives if the modulus goes to zero. status says what the bound is: certified on a supplied modulus or a linear model's, diagnostic on a sampled one, and refused -- the bound inf -- when the modulus is negative, because then no convexity argument applies and a finite number would be a fabrication, and when the modulus or the bound is not a finite number.

Raises:

Type Description
ValueError

if a supplied modulus is negative, infinite or nan, which is not a curvature; or if no plan in the box meets constraints, or a row is not as wide as the action sequence.