Conversation
- Standardize function signatures: solve_model and solve_model_numpy now use (c_init, a_init) order consistently
- Fix internal variable naming: use c_in/c_out and a_in/a_out for iteration variables
- Update β from 0.96 to 0.94 to support higher interest rates (up to 6%)
- Adjust interest rate ranges to [0, 0.05] to avoid instability
- Add new Timing subsection comparing NumPy vs JAX performance
- Simplify notation: a^e_{ij} → a_{ij} throughout
- Improve variable naming consistency: c_vals/ae_vals → c_vec/a_vec, c_in/a_in → c_out/a_out
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Development ProcessThis PR was developed through the following steps:
The code is now more consistent, more maintainable, and includes important performance comparison information for users deciding between implementations. |
|
📖 Netlify Preview Ready! Preview URL: https://pr-746--sunny-cactus-210e3e.netlify.app (fad3450) 📚 Changed Lecture Pages: ifp_egm |
Summary
This PR fixes variable naming inconsistencies in the IFP EGM lecture and adds a performance comparison between NumPy and JAX implementations.
Key Changes
1. Fixed Function Signatures and Variable Naming
solve_model()andsolve_model_numpy()now consistently use(c_init, a_init)orderc_in/a_in→c_out/a_outpattern consistentlysolve_model()function had undefined variablec_initin the initial state - now fixedc_out, a_outinstead of mixingc_vals,ae_vals, etc.2. Parameter Adjustments for Realistic Interest Rates
3. Added Performance Timing Section
block_until_ready()for accurate JAX timing4. Additional Improvements from Original Changes
a^e_{ij}→a_{ij}throughoutc_vals/ae_vals→c_vec/a_vecK()operatorTesting
The script runs successfully end-to-end:
Performance Results