# Economic Flat Earth revisited

**URL:** https://discourse.vfitoolkit.com/t/economic-flat-earth-revisited/680
**Category:** Uncategorized
**Created:** [June 24, 2026, 12:04am UTC](https://discourse.vfitoolkit.com/t/economic-flat-earth-revisited/680 "2026-06-24T00:04:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MichaelTiemann](https://discourse.vfitoolkit.com/user_avatar/discourse.vfitoolkit.com/michaeltiemann/32/220_2.png) [@MichaelTiemann](https://discourse.vfitoolkit.com/u/MichaelTiemann)
#### Post date: [June 24, 2026, 12:04am UTC](https://discourse.vfitoolkit.com/t/economic-flat-earth-revisited/680/1 "2026-06-24T00:04:19Z")

</div>

[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.

 ![Shocks_1yr_Delay](https://discourse.vfitoolkit.com/uploads/default/original/1X/fc136a654f23d455cc0d22d200dfab4e55147336.png)

 ![Shocks_1yr_NoDelay](https://discourse.vfitoolkit.com/uploads/default/original/1X/e16f3c1e038b0ca498db435a758086a6c9b36f48.png)

I’ll write more when I’m more confident about the sources of (programming) error.

For reference:

My return function: [https://github.com/MichaelTiemann/QEA-2026/blob/main/QEA\_ReturnFn.m](https://github.com/MichaelTiemann/QEA-2026/blob/main/QEA_ReturnFn.m)

> [@Economic flat earth created by ReturnFn?](https://discourse.vfitoolkit.com/t/economic-flat-earth-created-by-returnfn/618):
>
> I’m confused by the behavior of this part of my return function: %% Allow/Disallow some trivial agent decisions if (sprime-s\>0 && aprime+hprimecost\<0 ... % Cannot buy shares with negative net worth || agej\*ypp\>=11 && aprime\<-f\_coll\*hprimecost ... % Collateral constraint on borrowing (for older buyers that earn real money) || hprime\<h && aprime\<0 ... % Cannot sell down a house that is collateralized || agej\>=Jr && aprime\<0) …

> [@Precautionary savings in Lifecycle Analysis vs. economic efficiency](https://discourse.vfitoolkit.com/t/precautionary-savings-in-lifecycle-analysis-vs-economic-efficiency/652):
>
> Lifecycle analysis provides an opportunity to calculate optimal choices for consumption, investment, leisure, and bequests, even (or especially) in the case of uncertainty. That being said, I have also come to understand that humans tend to save more than their optimal agent counterparts would, leading to an excess of “Accidental Bequests”. The VFIToolkit lifecycle model can balance the lifetime utility function books by calculating a warmglow of bequest to make agent behavior match human beha…

---

<div class="post-metadata">

### Author: ![MichaelTiemann](https://discourse.vfitoolkit.com/user_avatar/discourse.vfitoolkit.com/michaeltiemann/32/220_2.png) [@MichaelTiemann](https://discourse.vfitoolkit.com/u/MichaelTiemann)
#### Post date: [July 8, 2026, 5:55pm UTC](https://discourse.vfitoolkit.com/t/economic-flat-earth-revisited/680/2 "2026-07-08T17:55:59Z")

</div>

I think I have found a better way to describe my problem, which leads to both a solution and a conundrum.

Imagine a model where agents can decide whether to buy alcohol or see a movie, but only if they have enough money at the end of the week. Agents below the legal drinking age cannot buy alcohol at all (regardless of their assets). Agents who have better or worse luck with employment may have discretionary assets to spend or not.

If we forbid agents based on `agej`, all agents of that age are forbidden, so we can return `-Inf` to exclude their choice. Easy.

If we forbid agents based on sufficiency of `a`, and `F` ultimately depends not only on `a` but also on `z` or `e`, then returning `-Inf` for the unlucky ones can prohibit all agents who share probabilities with the unlucky ones. I think this is one of the cliffs of the economic flat earth phenomena I’m confronting.

If instead of returning `-Inf`, we highly disfavor those who don’t have the means, but allow those with the means to exercise their choice, the resulting value function for the cohort is the finite weighted probabilities of the agents and their respective scores. If most can afford the choice, and a few cannot, the weighted score will be favorable and the Mean will reflect it. But it also means risking the fact that we make it possible for cohorts who _all_ lack sufficient means to slip through, albeit with a low Value function. (Aside: this is not unlike the distinction when using `sum` with `includenan` vs. `omitnan`.)

What is the “right” way to write value functions so that we can see heterogenous effects across agents without either (1) permitting all to make impossible choices that none can afford, or (2) forbidding all to make choices that some could legitimately make?

And just to check the maths: what happens to agents who are forbidden by all choices at a given stage? Do they simply disappear? And if so, should they take weight with them or not (by allowing a forbidden state to gain weight that does not otherwise affect the value functions as the model evolves)? I still lack an intuitive grasp of this aspect of the Toolkit.

What makes all of this more interesting/complicated is debt: a debt-funded `aprime` at one point in time may prove infeasible at another. When and how we mark states truly infeasible or merely disfavored has significant implications across both the Means and the Minimums/Maximums.

Here you can see the delineation of unlucky agents (chronically unemployed, then medical problems). In my new return function, there’s a Jubilee when `agej==Jr` (meaning that if they make it that far, debt is forgiven). You can see the unlucky agents being crushed by debt as their assets turn increasingly negative over time. The blue line is Mean, Purple and Yellow are Q19 and Q2 quantiles, and green is Maximum.

 ![unlucky_agents_h](https://discourse.vfitoolkit.com/uploads/default/original/1X/9c2a985927c1f3ae6dfac57d06fcc32bc4681208.png)

 ![unlucky_agents_a](https://discourse.vfitoolkit.com/uploads/default/original/1X/16f59fad7cecac816d3c615f1d96decadd2f150d.png)
