Skip to content

Commit 5590610

Browse files
jstacclaude
andcommitted
Add explanation of OPI performance across different m values
- Explains why m=1 is slower than VFI (implementation overhead) - Notes optimal performance at m=25-50 (3x speedup) - Explains degradation for large m (200, 400) - Emphasizes the 'sweet spot' concept for choosing m 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent c367468 commit 5590610

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lectures/ifp_opi.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,15 @@ ax.set_title('OPI execution time vs step size m')
381381
plt.show()
382382
```
383383

384-
We can see that OPI provides significant speedups over VFI, with the optimal value of m depending on the problem structure.
384+
The results show interesting behavior across different values of m:
385+
386+
* When m=1, OPI is actually slower than VFI, even though they should be mathematically equivalent. This is because the OPI implementation has overhead from computing the greedy policy and calling the policy operator, making it less efficient than the direct VFI approach for m=1.
387+
388+
* The optimal performance occurs around m=25-50, where OPI achieves roughly 3x speedup over VFI.
389+
390+
* For very large m (200, 400), performance degrades as we spend too much time iterating the policy operator before updating the policy.
391+
392+
This demonstrates that there's a "sweet spot" for the OPI step size m that balances between policy updates and value function iterations.
385393

386394
## Exercises
387395

0 commit comments

Comments
 (0)