Update Job Search III: Add utility function to mathematical formulation#690
Update Job Search III: Add utility function to mathematical formulation#690
Conversation
…mulation Modified mccall_model_with_sep_markov.md to correctly apply the CRRA utility function u(c, γ) = (c^(1-γ) - 1)/(1-γ) throughout the code implementation. Key changes: - Updated Bellman operator T() to use u(w_vals, γ) and u(c, γ) - Updated get_greedy() policy function to apply utility transformation - Modified plotting code to use utility-transformed values - Added γ parameter unpacking in all relevant functions - Fixed missing comma in create_js_with_sep_model() parameter list The code now correctly matches the mathematical formulation where wages and unemployment compensation enter the value functions through the utility function rather than directly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Implementation DetailsUpdated the lecture to ensure mathematical consistency between the theory and code: Mathematical Formulation (Bellman Equations)The lecture correctly specifies that wages and unemployment compensation enter through a utility function: Code ChangesPreviously, the code was using raw wage values Before: accept = d * (w_vals + α * β * P @ v)
reject = c + β * P @ vAfter: accept = d * (u(w_vals, γ) + α * β * P @ v)
reject = u(c, γ) + β * P @ vThis ensures the code matches the theoretical model, where risk aversion (controlled by γ) affects decision-making through the utility function rather than using linear utility implicitly. |
…mplementation Updated mccall_fitted_vfi.md to implement the continuous wage offer model with CRRA utility. Key changes: - Added CRRA utility function u(c, γ) = (c^(1-γ) - 1)/(1-γ) to mathematical formulation - Updated Model class to include ρ, ν, and γ parameters - Implemented Monte Carlo integration for computing conditional expectations (Pv_u)(w) - Updated Bellman operator T() to use u(w, γ) and u(c, γ) - Added get_greedy() function for computing optimal policy - Fixed all model unpacking throughout code - Implemented compute_expectation() using w' = w^ρ * exp(ν * z) with standard normal draws - Added Exercise 3: Exploring reservation wage as function of risk aversion γ - Reformatted text: each sentence on separate line for better version control Mathematical consistency: - Code now matches theory where wages and unemployment compensation enter through utility function - Monte Carlo approximation: (Pv_u)(w) ≈ (1/N) Σ v_u(w^ρ exp(ν z_i)) - Proper JAX implementation with interpolation for fitted value function iteration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Additional Update: Job Search IV (Fitted VFI) LectureI've now completed the Job Search IV: Fitted Value Function Iteration lecture ( Mathematical UpdatesAdded CRRA Utility to Bellman Operator: Monte Carlo Integration: Code Implementation
Key Features
The lecture now provides a complete treatment of continuous state space job search with risk aversion, demonstrating how fitted value function iteration handles infinite-dimensional problems through interpolation and Monte Carlo integration. |
|
@mmcky Can you please trigger a rebuild of this when you've merged your changes and the system is stable again? |
|
@jstac the latex build is reporting a missing equation reference
|
Added the label 🏷️ bell2mcmc to the Bellman operator equation and
converted it from $$ delimiters to the {math} directive to support
cross-references. This fixes the build warning:
WARNING: equation not found: bell2mcmc
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Ready to MergeThis PR is ready to merge. I've fixed the build error that was preventing the documentation from building. Build Fix AppliedFixed missing equation reference in Error: Fix: Added the label Merge StrategyThis PR should be merged before PR #691. PR #691 builds on top of this PR and includes:
After this PR is merged, PR #691 will need a simple rebase onto main, which should go smoothly with no conflicts. ✅ |
Summary
This PR updates the Job Search III lecture (
mccall_model_with_sep_markov.md) to properly apply the CRRA utility function throughout the code implementation.Key changes:
u(c, γ) = (c^(1-γ) - 1)/(1-γ)to all value function computationsT()to useu(w_vals, γ)andu(c, γ)instead of raw valuesget_greedy()policy function to apply utility transformationγparameter to model unpacking in all relevant functionscreate_js_with_sep_model()parameter listBenefits:
Test plan
mccall_model_with_sep_markov.pyscript runs successfully🤖 Generated with Claude Code