-
-
Notifications
You must be signed in to change notification settings - Fork 53
Split lake model lecture into two consecutive lectures #665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Split the lake_model.md lecture into two parts to improve readability and organization: 1. **lake_model.md** - Basic lake model with exogenous transition rates - Covers the foundational lake model theory - Aggregate and rate dynamics - Individual worker dynamics and ergodicity - Includes exercises that use only basic lake model functions 2. **endogenous_lake.md** - Extension with endogenous job finding rate - Makes the job finding rate endogenous using McCall search model - Fiscal policy analysis with unemployment insurance - Welfare optimization **Key changes:** - Created new endogenous_lake.md file with content from original line 624 onwards - Updated lake_model.md to end before the endogenous section - Added clear introduction to endogenous_lake.md indicating it's a continuation - Moved exercises (model_ex2, model_ex3) to end of lake_model.md (they only use basic functions) - Consolidated parameter source citations in lake_model.md where defaults are defined - Removed redundant parameter value listings in exercises - Updated plot colors to cycle through matplotlib's default colors (C0 for lines, C1 for hlines) - Updated _toc.yml to include both lectures consecutively 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
📖 Netlify Preview Ready! Preview URL: https://pr-665--sunny-cactus-210e3e.netlify.app (1861646) 📚 Changed Lecture Pages: endogenous_lake, lake_model |
Reorganized the endogenous lake model lecture for better readability and comprehension. **Changes:** - Split large monolithic code blocks into 12 smaller, focused blocks - Added descriptive sentences before each code block explaining its purpose - Separated function definitions from their usage and plotting code - Added new subsection "Computing optimal unemployment insurance" **Code block breakdown:** 1. Wage distribution function definition 2. Wage distribution creation and visualization 3. Utility function and McCall model data structure 4. Bellman equation operator 5. Value function iteration solver 6. Lake model functions (from previous lecture) 7. Economy parameters container 8. Function to compute optimal worker quantities 9. Function to compute steady state outcomes 10. Function to find balanced budget tax rate 11. Computation loop across policy range 12. Results visualization Each block now has a clear explanation of what it does and how it fits into the overall analysis, making the lecture more pedagogically effective. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Additional ImprovementsAdded a second commit that improves the readability and pedagogical flow of Code OrganizationSplit the large monolithic code blocks into 12 smaller, focused blocks:
Enhanced Documentation
These changes make the lecture much easier to follow, allowing students to understand each step of the analysis rather than being confronted with large blocks of code. |
Added an exercise exploring how the welfare-maximizing level of unemployment compensation varies with the job separation rate. **Exercise:** - Computes optimal unemployment compensation for different separation rates - Uses brute force search over c_vec to find welfare-maximizing c - Plots the relationship between α and optimal c - Includes economic interpretation of results **Solution shows:** - As separation rate increases, optimal unemployment insurance increases - Makes intuitive sense: more frequent job loss → higher value of insurance - Demonstrates practical application of the welfare optimization framework 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Exercise AddedAdded a third commit that includes an exercise in Exercise: Optimal Unemployment Insurance and Job SeparationThe exercise explores how the welfare-maximizing level of unemployment compensation varies with the job separation rate. Task:
Solution approach:
Key insight: This exercise gives students hands-on experience with:
|
|
📖 Netlify Preview Ready! Preview URL: https://pr-665--sunny-cactus-210e3e.netlify.app (16aca76) 📚 Changed Lecture Pages: endogenous_lake, lake_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-665--sunny-cactus-210e3e.netlify.app (848e7f1) 📚 Changed Lecture Pages: endogenous_lake, lake_model |
|
📖 Netlify Preview Ready! Preview URL: https://pr-665--sunny-cactus-210e3e.netlify.app (0503f6d) 📚 Changed Lecture Pages: endogenous_lake, lake_model |
The exercise solution was producing an unstable, noisy relationship between separation rate and optimal unemployment compensation due to extremely flat welfare function near its maximum. Changes: - Expanded α range from [0.01, 0.025] to [0.01, 0.04] with fewer points (8 vs 15) - Increased c grid resolution from 40 to 150 points - Implemented centroid method: compute weighted average of near-optimal c values instead of using argmax, which is unstable on flat functions - Updated solution text to correctly state that optimal c decreases (not increases) with separation rate, with proper economic explanation Result: Clean, monotonically decreasing relationship from c=68.88 to c=60.72 as α increases from 0.01 to 0.04. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed Unstable Exercise Solution in
|
|
@mmcky Would you mind to fix this and then merge it? Could you also please make it live (along with another new lecture I just merged)? |
lectures/endogenous_lake.md
Outdated
| V, U = solve_mccall_model(mcm) | ||
| w_idx = jnp.searchsorted(V - U, 0) | ||
| w_bar = jnp.where(w_idx == len(V), jnp.inf, mcm.w_vec[w_idx]) | ||
| λ = γ * jnp.sum(p_vec * (w_vec > w_bar)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jstac the name 'γ' is not defined.
Should the value match the Economy below γ=1.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mmcky ! please change to mcm.γ
Removed incomplete statement `model.` on line 489 that was causing a syntax error when converting to Python with jupytext. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Fixed a syntax error in endogenous_lake.md - removed an incomplete statement |
|
📖 Netlify Preview Ready! Preview URL: https://pr-665--sunny-cactus-210e3e.netlify.app (dcea44f) 📚 Changed Lecture Pages: endogenous_lake, lake_model |
|
🥳 - thanks @jstac. Will make live now. |
Summary
This PR splits the lake model lecture into two consecutive lectures to improve readability and pedagogical flow.
Changes
1. lake_model.md (Basic Lake Model)
2. endogenous_lake.md (Lake Model with Endogenous Job Finding Rate)
Improvements
Testing
Both lecture files have been converted to Python and tested successfully using jupytext.
🤖 Generated with Claude Code