# Bug in StationaryDist\_FHorz\_Iteration\_SemiExo\_noz\_raw

**URL:** https://discourse.vfitoolkit.com/t/bug-in-stationarydist-fhorz-iteration-semiexo-noz-raw/619
**Category:** Uncategorized
**Created:** [March 30, 2026, 5:29pm UTC](https://discourse.vfitoolkit.com/t/bug-in-stationarydist-fhorz-iteration-semiexo-noz-raw/619 "2026-03-30T17:29:23Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![aledinola](https://discourse.vfitoolkit.com/letter_avatar_proxy/v4/letter/a/3ec8ea/32.png) [@aledinola](https://discourse.vfitoolkit.com/u/aledinola)
#### Post date: [March 30, 2026, 10:40pm UTC](https://discourse.vfitoolkit.com/t/bug-in-stationarydist-fhorz-iteration-semiexo-noz-raw/619/5 "2026-03-30T22:40:55Z")

</div>

> [@robertdkirkby](#):
>
> I guess I am going to go look at all the others now. Maybe I will set up some tests on it.

I have shared my code on a [public repo](https://github.com/aledinola/life-cycle-search). I hope it helps for your tests. This is the workflow that I’ve followed:

- I started with a toy model coded with the VFI-toolkit. The model is explained in the accompanying pdf.
- Then I asked an AI (Codex) to recode the model using simple Matlab code on the cpu.
- Test for discrepancies b/w the toolkit results and the manual results.
- If there are discrepancies, investigate the source.

This is how I spotted the bugs in the toolkit. I used to do this myself in the past but now with Codex is much faster.

By the way, the bug in the stationary distribution was subtle because the toolkit function did not return an error message. The original code was just always using the pi\_semiz\_J for age=1.

---

_[View the full topic](https://discourse.vfitoolkit.com/t/bug-in-stationarydist-fhorz-iteration-semiexo-noz-raw/619)._
