Complete example models built with pylcm, ordered from simplest to most complex.
All models live in the lcm_examples package and can be imported directly.
Tiny Consumption-Savings —
lcm_examples.tinyMinimal 2-regime model. 3 periods, discrete labor, log-spaced grids, tax-and-transfer system.Mortality —
lcm_examples.mortality3-regime model with death. Discrete labor, borrowing constraint.Precautionary Savings —
lcm_examples.precautionary_savings2-regime model with income shocks. IID, Rouwenhorst, and Tauchen shock types.Precautionary Savings with Health —
lcm_examples.precautionary_savings_health2-regime model with health & exercise. Multiple continuous states and actions, auxiliary functions, constraints.Mahler & Yum (2024) —
lcm_examples.mahler_yum_2024Full Econometrica replication. 8 states, stochastic transitions, data files, discount-factor heterogeneity. Requires GPU.
Customizing models¶
All models export regime objects that can be customized via .replace():
from lcm import LinSpacedGrid
from lcm_examples.mortality import working_life
# Use a finer wealth grid
custom_regime = working_life.replace(
states={"wealth": LinSpacedGrid(start=1, stop=1000, n_points=500)},
)See Regimes for more on .replace().