Steady-State Warm Start#
warm_start.py modules
ogzaf.warm_start#
Warm-start the steady-state solve from a previously solved state.
OG-Core cold-starts every steady-state solve from constants (household savings
and labour at fixed values, the outer unknowns from the initial_guess_*
parameters). That seed can sit far from the solution, and the single
constants OG-Core accepts for b and n cannot carry the shape of a
solved distribution. This module seeds the solver from a state that has
already solved: the household matrices and every outer unknown together, so
they are mutually consistent, with factor passed directly.
b and n are in model units, so a seed stays valid across modest
parameter moves. Regenerate it with python examples/save_warm_start.py
after any large recalibration.
Ported from OG-KOR’s ogkor/warm_start.py (itself from OG-JPN).
- ogzaf.warm_start.enable(path='/home/runner/work/OG-ZAF/OG-ZAF/ogzaf/data/ss_warm_start.pkl')[source]#
Patch
SS.SS_initial_guessesto start from the stored seed.Call once before solving. Does nothing if no seed is stored, so a fresh checkout still runs (slowly) rather than failing.
- Parameters:
path (str) – seed written by
save_seed()- Returns:
True if a warm start is now active
- Return type:
bool
- ogzaf.warm_start.save_seed(ss_vars, path='/home/runner/work/OG-ZAF/OG-ZAF/ogzaf/data/ss_warm_start.pkl')[source]#
Store the parts of a solved steady state needed to warm-start another.
- Parameters:
ss_vars (dict) – a solved
SS_vars.pklpath (str) – where to write the seed
- Returns:
the path written
- Return type:
str