2. Explicit complementarity and level inputs
The public policy and compartment examples retain their original equations, calibration and deterministic paths. The pinned public replication and its license are stored alongside the examples.
An equation label is descriptive. The economic inequalities are imposed by actual maximum or minimum equations.
2.1. Policy-rate constraint
For the positive source convention of the multiplier \(\xi_2\) and \(\sigma>0\), the rate constraint is
This replaces the unconstrained zero-multiplier equation. Both the commitment and discretion examples retain their other first-order conditions. In the discretion example, the original indicator selects between the constrained policy variable and the Taylor-rule rate. The displayed annualized rate retains the source definition; the bound is also imposed on the policy variable used in the equilibrium equations.
The original natural-rate path is a level: its reference is 1 and the
temporary value is -1 in periods 1 through 6. The recovered model keeps
r_nat as a level variable and defines
r_nat=r_nat_bar+e_r_nat. Thus the reference parameter is 1 and
the corresponding temporary deviation input is -2.
2.2. Compartment bounds
The source compartment equations have a lower bound on susceptible population and upper bounds on recovered and infected population. Their equivalent native equations are
The contact rate beta remains a level variable. Its reference is 2.1,
with a separately named deviation input e_beta. Reported reproduction
numbers and contact-rate controls therefore keep their original units.
The original recovery rate, population, symptom probabilities and
initial infected count are retained.
All three public scenarios A, B and C are supplied. The source assigns two values to week 17 in scenario C; the later assignment (0.4) applies. Its rate is 2.1 in weeks 1–12, 0.176 in weeks 13–16 and 0.4 in weeks 17–52. This follows the source declaration order and assignment routine, without changing its equations or calibration.
2.3. Running and checking
With RISE started, add the tutorial folder to the MATLAB path and run
[path,model]=quoted_complementarity_example(tests_root,'commitment'),
select 'discretion', or select 'sir','A', 'sir','B' or 'sir','C'.
The tests repository root is tests_root.
The deterministic solves use unsmoothed kinks and explicit reference states. Initial date 0 and terminal date \(H+1\) enclose the solved interior dates. Validation checks actual first-order/equilibrium conditions, rates, multipliers, complementary products and reporting units. The compartment checks also evaluate accounting and population bounds on the two supplied paths. They do not establish those accounting properties for arbitrary inputs at which the source bounds become active. No stochastic solution or equilibrium-uniqueness claim is made.
2.4. Small path residuals
The Newton linear step retains every nonzero right-hand side, including values below the square root of machine precision. The requested residual and step tolerances govern convergence. This matters when the initial infected population share is very small. The sequential block solve and original equations remain in use.