Skip to content

Spec 0.1p (placeholder): Intermediate-variable indexing in perch tags

Version: 0.1p (placeholder) Date: 2026-02-11 Status: Planned Author: Akshay Shanker


0. Motivation

The EGM InvEuler sub-equation recovers consumption as a function of an intermediate variable \(a\) (post-consumption assets), not of a canonical perch variable (\(m\) at decision, \(m'\) at continuation). The current bracket-index syntax supports only the three canonical perch tags ([_arvl], [_dcsn], [_cntn]). This spec extends the syntax to allow arbitrary variable names as bracket indices, e.g. c[_a].

The problem

In the dcsn_to_cntn_transition:

dcsn_to_cntn_transition: |
  a = m_d - c
  m_next = a*R + θ

The intermediate variable a is defined as part of the transition but is neither the decision-perch variable (\(m_d\)) nor the continuation-perch variable (\(m_\text{next}\)). The InvEuler and InvPol sub-equations produce objects indexed by a:

cntn_to_dcsn_opr:
  InvEuler: |
    c[_a] = (β*R*E_{θ}(dV[>]))^(-1/γ)
  InvPol: |
    m_d[_a] = c[_a] + a

Here c[_a] means "consumption as a function of post-consumption assets \(a\)" -- a measurability statement. The RHS of InvEuler contains an expectation \(E_\theta(\cdot)\), so c cannot be measurable w.r.t. the continuation filtration \(\mathcal{F}_\succ\) (which includes the shock \(\theta\)). Instead, c is measurable w.r.t. the sub-\(\sigma\)-algebra generated by the intermediate variable \(a\).

Similarly, m_d[_a] in InvPol recovers the endogenous grid point as a function of a.

Generalisation

This pattern arises whenever:

  1. The dcsn_to_cntn_transition introduces an intermediate variable (e.g. \(a = m - c\)) before the continuation state.
  2. A mover sub-equation (InvEuler, InvPol) produces a result conditioned on that intermediate variable.

The intermediate variable acts as a local perch within the mover — finer than the decision perch (knows \(a\)) but coarser than the continuation perch (does not know \(\theta\)).


1. Scope

In scope

  • Syntax: allow [_<varname>] where <varname> is declared in dcsn_to_cntn_transition as an intermediate variable.
  • Parser: extend Dolang+ bracket-index recognition to accept non-canonical tags and resolve them against the transition's intermediate variables.
  • Validation: check that the intermediate variable exists in the transition and that the measurability claim is consistent (no post-index shocks on the RHS).

Out of scope (0.1p)

  • Arbitrary filtration-indexed symbols (full \(\sigma\)-algebra annotations).
  • Runtime compilation of c[_a] into gufunctions (this is a syntax/representation spec only).
  • Multi-dimensional intermediate indices.

2. Proposed syntax

# Intermediate variable introduced in transition
dcsn_to_cntn_transition: |
  a = m_d - c
  m_next = a*R + θ

# Mover sub-equations indexed by intermediate variable
cntn_to_dcsn_opr:
  InvEuler: |
    c[_a] = (β*R*E_{θ}(dV[>]))^(-1/γ)
  InvPol: |
    m_d[_a] = c[_a] + a

The tag [_a] is resolved as follows:

  1. a must appear as an LHS variable in dcsn_to_cntn_transition (intermediate, not the final poststate).
  2. c[_a] declares that c is a function of a — i.e. c is \(\mathcal{F}_a\)-measurable where \(\mathcal{F}_a = \sigma(a)\).
  3. The translator (0.1b) maps [_a] to the appropriate time index for the target Dolo block (e.g. [t] for direct_response_egm).

3. Relationship to other specs

  • 0.1l (Perch semantics): c[_a] is a special case of "perch-indexed symbols as function evaluations". Spec 0.1l defines the general framework; 0.1p provides the concrete syntax for intermediate-variable indices.
  • 0.1b (Translator): the translator must handle [_a][t] mapping via the MOVER_PERCH_OFFSETS_OVERRIDE mechanism or a new intermediate-index rule.
  • 0.1g (Bare symbol resolution): bare symbols within InvEuler/InvPol that are intermediate variables should resolve to the intermediate-variable perch, not to a canonical perch.

4. Open questions

  • Should intermediate-variable tags be explicitly declared in symbols: or inferred from transition equations?
  • How does the translator handle multiple intermediate variables (e.g. a and b in a multi-line transition)?
  • Is [_a] always a valid measurability claim, or should the parser verify that no post-a shocks appear in the RHS?

5. References