Fix variable naming and add timing comparison to IFP EGM lecture #746
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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