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:
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:
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:
- The
dcsn_to_cntn_transitionintroduces an intermediate variable (e.g. \(a = m - c\)) before the continuation state. - 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 indcsn_to_cntn_transitionas 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:
amust appear as an LHS variable indcsn_to_cntn_transition(intermediate, not the final poststate).c[_a]declares thatcis a function ofa— i.e.cis \(\mathcal{F}_a\)-measurable where \(\mathcal{F}_a = \sigma(a)\).- The translator (0.1b) maps
[_a]to the appropriate time index for the target Dolo block (e.g.[t]fordirect_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 theMOVER_PERCH_OFFSETS_OVERRIDEmechanism 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.
aandbin a multi-line transition)? - Is
[_a]always a valid measurability claim, or should the parser verify that no post-ashocks appear in the RHS?
5. References¶
- Solving via conjugation — §4.1: first use of
c[_a]notation. - Symbol conventions: bracket-index notation.
- Spec 0.1l: perch-indexed symbols as function evaluations (planned).