Bug in StationaryDist_FHorz_Iteration_SemiExo_noz_raw

I have shared my code on a public repo. 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.