# Pseudo-code with math

**URL:** https://discourse.vfitoolkit.com/t/pseudo-code-with-math/215
**Category:** Uncategorized
**Created:** [August 24, 2023, 10:07am UTC](https://discourse.vfitoolkit.com/t/pseudo-code-with-math/215 "2023-08-24T10:07:32Z")
**Posts on this page:** 6
**Page:** 2

<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: [May 27, 2026, 9:02pm UTC](https://discourse.vfitoolkit.com/t/pseudo-code-with-math/215/21 "2026-05-27T21:02:53Z")

</div>

I found a few mistakes in [Pseudocodes/VFI\_PseudoCodes.pdf at main · vfitoolkit/Pseudocodes · GitHub](https://github.com/vfitoolkit/Pseudocodes/blob/main/VFI_PseudoCodes.pdf), Section 2.1.1 Refinement.

1. **Preliminary step**. We need also a loop over a^\prime since we maximize over d for all (a',a,z)  

2. The policy for a^\prime is sometimes denoted g^{a^\prime}\_n, other times g\_n

It would be useful to let an AI scan the pseudocode document for inconsistent notation and imprecisions.

---

<div class="post-metadata">

### Author: ![robertdkirkby](https://discourse.vfitoolkit.com/user_avatar/discourse.vfitoolkit.com/robertdkirkby/32/287_2.png) [@robertdkirkby](https://discourse.vfitoolkit.com/u/robertdkirkby)
#### Post date: [May 28, 2026, 9:06am UTC](https://discourse.vfitoolkit.com/t/pseudo-code-with-math/215/22 "2026-05-28T09:06:08Z")

</div>

Hopefully fixed them all

> <https://github.com/vfitoolkit/Pseudocodes/commit/06a09ec960e609b8cfb7003adf90d5dadf9b95d6>

---

<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: [May 28, 2026, 10:00am UTC](https://discourse.vfitoolkit.com/t/pseudo-code-with-math/215/23 "2026-05-28T10:00:05Z")

</div>

Did you reconpile the tex? The two points I flagged in my post are not fixed yet.

---

<div class="post-metadata">

### Author: ![robertdkirkby](https://discourse.vfitoolkit.com/user_avatar/discourse.vfitoolkit.com/robertdkirkby/32/287_2.png) [@robertdkirkby](https://discourse.vfitoolkit.com/u/robertdkirkby)
#### Post date: [May 28, 2026, 8:02pm UTC](https://discourse.vfitoolkit.com/t/pseudo-code-with-math/215/24 "2026-05-28T20:02:52Z")

</div>

The AI wasn’t as smart as you so it missed that one.

Fixed now

> <https://github.com/vfitoolkit/Pseudocodes/commit/1d69047aa48d060932a34c99f44a1c57ae76abc6>

---

<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: [June 21, 2026, 5:18pm UTC](https://discourse.vfitoolkit.com/t/pseudo-code-with-math/215/25 "2026-06-21T17:18:44Z")

</div>

Related to the pseudo-code on grid interpolation: I noticed that the explanation of linear interpolation for finite horizon VFI is no longer present in [GitHub - vfitoolkit/Pseudocodes: Pseudocodes for the commands of VFI Toolkit · GitHub](https://github.com/vfitoolkit/Pseudocodes)

I found a really nice explanation of how the toolkit uses linear interpolation in VFI in [GitHub - robertdkirkby/GridInterpolationLayer: description of grid interpolation layer algo · GitHub](https://github.com/robertdkirkby/GridInterpolationLayer). The figures are great!  
The pseudo-code for grid interpolation with finite-horizon vfi is good but the section with decision variable is missing. It was instead present in a previous version of [GitHub - vfitoolkit/Pseudocodes: Pseudocodes for the commands of VFI Toolkit · GitHub](https://github.com/vfitoolkit/Pseudocodes)

To sum up, I have a small request: is it possible to show somewhere the pseudo-code for “finite-horizon with d variable” plus “gridinterplayer”? This helps users (and AI tools as well) to better understand the code.

---

<div class="post-metadata">

### Author: ![robertdkirkby](https://discourse.vfitoolkit.com/user_avatar/discourse.vfitoolkit.com/robertdkirkby/32/287_2.png) [@robertdkirkby](https://discourse.vfitoolkit.com/u/robertdkirkby)
#### Post date: [July 6, 2026, 1:57am UTC](https://discourse.vfitoolkit.com/t/pseudo-code-with-math/215/26 "2026-07-06T01:57:22Z")

</div>

I put links to grid interpolation layer and divide and conquer pdfs/repos in the pseudo-codes pdf.

Added the ‘conditional on d’ explanation to the grid interpolation layer pdf.

[Previous page](https://discourse.vfitoolkit.com/t/pseudo-code-with-math/215.md?page=1)
