[EDITED] I now have another case of the economic flat earth problem, this time in the context of precautionary savings. TL;DR: more than likely caused by latent problems when experienceassetz attempts to interpolate points that border on -Inf.
Starting from LifeCycleModel21, my agents also have the opportunity to invest in a retirement scheme and/or solar+battery shares. The former pays 7%, with employers matching employee contributions, but funds cannot be withdrawn until retirement. The latter offset energy costs efficiently (up to zeroing them out when generation/capacity equals energy consumption) and generates income weakly (crediting half the value of excess generation to other income that is not eligible for retirement funding).
I think the root cause is that when the return function delivers an infeasible solution to ValueFnIter_FHorz_ExpAssetz_raw, that -Inf value poisons all the “preceding” age calculations. I came to this conclusion by changing the ExogShock function to make the Z value in the employment/unemployment interpretation a 50/50 split and saw precautionary spending as expected. As I shifted how much my agent is paid while employed vs. unemployed, I saw the precautionary spending disappear the moment that the unemployment benefit fell below retirement contributions and energy costs. I.e., as soon as the ReturnFn ever returned -Inf.
I know that the code to deal with -Inf in grid interpolation is still fresh (which experienceassetz does in its own way). I think I hit that edge case. So I’ll use a large negative number for now.
As for my other ramblings…the changes I made to grid sizes et al did have various side-effects that likely make the -Inf not reachable. That was the real problem. With a large negative number, judiciously applied, things behave now as expected.
I’ll write more when I’m more confident about the sources of (programming) error.
For reference:
My return function: QEA-2026/QEA_ReturnFn.m at main · MichaelTiemann/QEA-2026 · GitHub



