Skip to content

Method Schemes Reference

Schemes are registered string identifiers for the kind of numerical task a methodization entry declares. Unlike methods (which are opaque tags interpreted downstream), scheme names are validated against a registry. This page lists all registered schemes.

See 04 Methodization for the full methodization syntax and semantics.

Scheme entry structure

Each scheme entry appears inside a schemes: list on a methodization target:

- on: <target-id>
  schemes:
    - scheme: <registered-scheme-name>
      method: <opaque-tag-or-string>    # optional
      settings: { <key>: <symbol>, ... } # optional
  • scheme: registered name (this page)
  • method: opaque — downstream solvers interpret (e.g. !gauss-hermite, !egm, !linear)
  • settings: keys map to settings symbol names declared in symbols.settings; numeric values live in settings.yaml

Core schemes

These are the primary registered schemes used across all stages.

expectation

Numerical integration over a named shock or joint shock vector.

Key Description
Attaches to Operator instance extracted from equation body (e.g. E_θ, E_Ψ_θ)
Purpose Select quadrature/sampling rule for computing \(\mathbb{E}_\zeta[\cdot]\)
Common methods !gauss-hermite, !monte-carlo, !quadrature
Typical settings n_nodes (number of quadrature nodes)
- on: E_θ
  schemes:
    - scheme: expectation
      method: !gauss-hermite
      settings:
        n_nodes: n_θ_nodes

bellman_backward

Algorithm selection for the backward mover (cntn→dcsn direction). This is the top-level solve method for the stage's Bellman equation.

Key Description
Attaches to cntn_to_dcsn_mover
Purpose Select the backward-solution algorithm
Common methods !vfi (value function iteration), !egm (endogenous grid method), !expectation (pure expectation, no optimization)
Typical settings maxit (max iterations), tol (convergence tolerance)
- on: cntn_to_dcsn_mover
  schemes:
    - scheme: bellman_backward
      method: !egm

The choice of bellman_backward method determines which sub-equations the solver/whisperer compiles:

Method Sub-equations used
!vfi Bellman + dcsn_to_cntn_transition
!egm InvEuler + MarginalBellman + cntn_to_dcsn_transition + dcsn_to_cntn_transition
!expectation Bellman only (no optimization — pure expectation mover)

grid

Discretization of a state space onto a computational grid at the target of the mover.

Key Description
Attaches to cntn_to_dcsn_mover or sub-equation targets (e.g. cntn_to_dcsn_mover.InvEuler)
Purpose Specify the grid on which value/policy functions are represented
Common methods !Cartesian (regular grid), !Smolyak (sparse grid)
Typical settings orders (number of grid points per dimension), bounds (domain bounds)
- on: cntn_to_dcsn_mover
  schemes:
    - scheme: grid
      method: !Cartesian
      settings:
        orders: [n_k]
        bounds: [[k_min, k_max]]

Note

grid specifies the discretization of the state space (how many points, where). interpolation specifies how to evaluate between those grid points. They are separate concerns and appear as separate scheme entries.

interpolation

Interpolation method for evaluating functions between grid points.

Key Description
Attaches to cntn_to_dcsn_mover or sub-equation targets
Purpose Select how value/policy functions are interpolated off-grid
Common methods !linear, !Cartesian (with grid settings), !cubic, !spline
Typical settings When grid is not declared separately: orders, bounds, domain
- on: cntn_to_dcsn_mover
  schemes:
    - scheme: interpolation
      method: !linear

Important

In some existing examples, interpolation with method: !Cartesian and orders/bounds settings conflates grid construction with interpolation method. The preferred pattern (as of spec_0.1d) is to use grid for discretization and interpolation for the interpolation method separately.

maximization

Optimization algorithm for control variables within the backward mover.

Key Description
Attaches to cntn_to_dcsn_mover
Purpose Select the optimizer for max_{c}(·) in the Bellman equation
Common methods !scipy-bounded (scalar bounded optimization), !grid-search (discrete enumeration)
Typical settings (method-specific)
# Continuous control with bounded optimizer
- on: cntn_to_dcsn_mover
  schemes:
    - scheme: maximization
      method: !scipy-bounded

# Discrete choice via grid search
- on: cntn_to_dcsn_mover
  schemes:
    - scheme: maximization
      method: !grid-search

Note

When bellman_backward uses !egm, the maximization scheme is typically absent because EGM bypasses direct optimization. When using !vfi, the maximization scheme specifies how the max is computed.

simulation

Forward simulation / distribution propagation method for forward movers.

Key Description
Attaches to Forward mover targets: arvl_to_dcsn_mover, dcsn_to_cntn_mover
Purpose Select how distributions are pushed forward through transitions
Common methods !monte-carlo (random sampling), !deterministic (no randomness in this leg)
Typical settings n_paths (number of simulation paths), seed (random seed)
- on: dcsn_to_cntn_mover
  schemes:
    - scheme: simulation
      method: !monte-carlo
      settings:
        n_paths: n_sim
        seed: sim_seed

Extended schemes

upper_envelope

Upper envelope refinement for non-convex EGM problems (e.g. discrete-continuous choice).

Key Description
Attaches to cntn_to_dcsn_mover
Purpose Select the upper-envelope algorithm for handling EGM non-convexities
Common methods !FUES, !CONSAV, !DC-EGM
Typical settings kwargs_by_method (method-specific keyword arguments)
- on: cntn_to_dcsn_mover
  schemes:
    - scheme: upper_envelope
      method: !FUES
      settings:
        kwargs_by_method: ue_kwargs

Summary table

Scheme Target type Purpose Example methods
expectation Operator instance (E_*) Quadrature / sampling !gauss-hermite, !monte-carlo
bellman_backward cntn_to_dcsn_mover Backward solution algorithm !vfi, !egm, !expectation
grid Mover or sub-equation State space discretization !Cartesian, !Smolyak
interpolation Mover or sub-equation Off-grid evaluation !linear, !Cartesian, !cubic
maximization cntn_to_dcsn_mover Control optimization !scipy-bounded, !grid-search
simulation Forward movers Distribution propagation !monte-carlo, !deterministic
upper_envelope cntn_to_dcsn_mover Non-convex EGM refinement !FUES, !CONSAV

Worked examples

VFI stage (port_stage)

- on: cntn_to_dcsn_mover
  schemes:
    - scheme: bellman_backward
      method: !vfi
    - scheme: grid
      method: !Cartesian
      settings:
        orders: [n_k]
        bounds: [[k_min, k_max]]
    - scheme: interpolation
      method: !linear
    - scheme: maximization
      method: !scipy-bounded

Four schemes on one target: the algorithm (bellman_backward), the grid (grid), how to interpolate (interpolation), and how to optimize (maximization).

EGM stage (cons_stage)

- on: cntn_to_dcsn_mover
  schemes:
    - scheme: bellman_backward
      method: !egm
    - scheme: interpolation
      method: !Cartesian
      settings:
        orders: [n_m]
        bounds: [[m_min, m_max]]

- on: cntn_to_dcsn_mover.InvEuler
  schemes: []

- on: cntn_to_dcsn_mover.MarginalBellman
  schemes: []

No maximization scheme — EGM bypasses direct optimization. The sub-equation targets (InvEuler, MarginalBellman) appear in the exhaustive listing but need no scheme attachment — the parent's bellman_backward: !egm already tells the solver which sub-equations to compile.

Pure expectation stage (noport_stage)

- on: cntn_to_dcsn_mover
  schemes:
    - scheme: bellman_backward
      method: !expectation
    - scheme: interpolation
      method: !Cartesian
      settings:
        orders: [n_m]
        bounds: [[m_min, m_max]]

No maximization, no EGM sub-equations — just expectation and interpolation.