A two-regime consumption-savings model with income shocks (alive + dead). Supports IID shocks (Normal Gauss-Hermite) and persistent AR(1) shocks (Rouwenhorst, Tauchen). Configurable interest rate and wealth grid type.
With FGP-calibrated parameters, this replicates the simplified benchmark of Fella et al. (2019).
Usage¶
import jax.numpy as jnp
from lcm_examples.precautionary_savings import get_model, get_params
model = get_model(n_periods=7, shock_type="rouwenhorst")
params = get_params(shock_type="rouwenhorst", sigma=0.1, rho=0.95)
result = model.solve_and_simulate(
params=params,
initial_conditions={
"age": jnp.full(100, model.ages.values[0]),
"wealth": jnp.linspace(1, 10, 100),
"income": jnp.zeros(100),
"regime_id": jnp.full(100, model.regime_names_to_ids["alive"]),
},
)
df = result.to_dataframe(additional_targets="all")- Fella, G., Gallipoli, G., & Pan, J. (2019). Markov-Chain Approximations for Life-Cycle Models. Review of Economic Dynamics, 34, 183–201. 10.1016/j.red.2019.03.013