Consumption-Savings with IID Shocks¶
A single-stage lifecycle model solved via EGM.
This example demonstrates the simplest complete dolo-plus model: a single stage containing both expectation and maximization, designed for solution via the Endogenous Grid Method (EGM).
Model Overview¶
| Feature | Description |
|---|---|
| Stages | 1 (self-contained stage with both expectation and maximization) |
| Shocks | IID log-normal income shock |
| Solution | Endogenous Grid Method (EGM) |
| State | Wealth w (cash-on-hand) |
Economic Problem¶
The agent solves: $$ V(b) = \mathbb{E}_y \left[ \max_c \left{ u(c) + \beta V(a) \right} \right] $$
where:
- b = beginning-of-period assets (prestate)
- y = income shock (exogenous)
- w = exp(y) + b*r = cash-on-hand (state after shock)
- c = consumption (control)
- a = w - c = end-of-period assets (poststate)
ADC Stage Structure¶
- Arrival → Decision: Income shock realized,
w = exp(y) + b*r - Decision → Continuation: Consumption choice,
a = w - c
Files¶
| File | Purpose |
|---|---|
stage.yaml |
Stage syntax (symbols, equations) |
calibration.yaml |
Parameter values |
settings.yaml |
Grid sizes, bounds |
methodization.yml |
Solution scheme (EGM recipe) |
Stage YAML¶
name: consumption_savings_iid_egm_doloplus
symbols:
spaces:
Xb: "@def R+" # prestate assets
Xw: "@def R+" # cash-on-hand
Xa: "@def R+" # end-of-period assets
Y: "@def R" # income support
prestate:
b: "@in Xb"
exogenous:
y:
- "@in Y"
- "@dist Normal(μ_y, σ_y)"
states:
w: "@in Xw"
poststates:
a: "@in Xa"
controls:
c: "@in R+"
values:
V: "@in R"
values_marginal:
dV: "@in R+"
parameters:
β: "@in (0,1)"
γ: "@in R+"
r: "@in R++"
μ_y: "@in R"
σ_y: "@in R+"
equations:
# Half-transition: shock realization
arvl_to_dcsn_transition: |
w = exp(y) + b*r
# Budget constraint
dcsn_to_cntn_transition: |
a = w - c
# Reverse state for EGM
cntn_to_dcsn_transition: |
w = a + c
# Backward mover with EGM sub-equations
cntn_to_dcsn_opr:
Bellman: |
V = max_{c}((c^(1-γ))/(1-γ) + β*V[>])
InvEuler: |
c[>] = (β*dV[>])^(-1/γ)
MarginalBellman: |
dV = (c)^(-γ)
# Expectation operator
dcsn_to_arvl_opr:
Bellman: |
V[<] = E_{y}(V)
MarginalBellman: |
dV[<] = r * E_{y}(dV)
Key Features¶
Single Stage with Both Operators¶
Unlike the port-with-shocks model (which separates expectation and maximization), this model contains both in one stage:
- dcsn_to_arvl_opr: Expectation over income shock
- cntn_to_dcsn_opr: Maximization via EGM
EGM Sub-Equations¶
The cntn_to_dcsn_opr block contains:
1. InvEuler: Compute consumption from marginal value
2. MarginalBellman: Envelope condition for marginal value
3. cntn_to_dcsn_transition: Reverse mapping w = a + c
Marginal Value Propagation¶
The MarginalBellman in dcsn_to_arvl_opr:
r.