Skip to content

Standardize value function notation in Job Search II lecture#686

Merged
jstac merged 4 commits intomainfrom
mcc_e2
Nov 10, 2025
Merged

Standardize value function notation in Job Search II lecture#686
jstac merged 4 commits intomainfrom
mcc_e2

Conversation

@jstac
Copy link
Contributor

@jstac jstac commented Nov 10, 2025

Summary

This PR standardizes the value function notation in the Job Search II lecture (mccall_model_with_separation.md) to match the notation used in Job Search III (mccall_model_with_sep_markov.md).

Changes Made

Mathematical Notation

  • Employed value function: Changed from v(w) to v_e(w)
  • Unemployed value function: Changed from h(w) to v_u(w)
  • Continuation value: Changed from h to v_u^* (where v_u^* = u(c) + β d)

Updated Throughout

  • All Bellman equations (bell1_mccall, bell2_mccall, bell01_mccall, bell02_mccall)
  • Iterative update rules (bell1001, bell2001)
  • Code implementation in update() and solve_model() functions
  • Plot labels and variable names
  • Function documentation and explanatory text

Benefits

  • Consistency: Both job search lectures now use the same intuitive notation
  • Clarity: v_e clearly indicates "value for employed" and v_u indicates "value for unemployed"
  • Easier cross-referencing: Students can more easily compare and contrast the two models

Testing

  • ✅ Code has been tested by converting to Python and executing successfully
  • ✅ All mathematical equations remain logically consistent
  • ✅ No changes to computational results, only notation

🤖 Generated with Claude Code

This commit standardizes the value function notation in the Job Search II lecture to match the notation used in Job Search III (mccall_model_with_sep_markov.md).

Key changes:
- Renamed v(w) → v_e(w) for employed worker's value function
- Renamed h(w) → v_u(w) for unemployed worker's value function
- Updated continuation value h → v_u^* in explanations
- Updated all Bellman equations and mathematical expressions
- Updated code variables (v → v_e, h → v_u_star)
- Updated plot labels to reflect new notation
- Updated function documentation and comments

This standardization improves consistency across the job search lecture series and makes the notation more intuitive (e for employed, u for unemployed).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jstac
Copy link
Contributor Author

jstac commented Nov 10, 2025

Detailed Notation Mapping

For reference, here's the complete mapping of notation changes:

Old Notation New Notation Description
v(w) v_e(w) Value function for employed worker at wage w
h(w) v_u(w) Value function for unemployed worker with offer w
h v_u^* Continuation value (constant)
v_new v_e_new Updated employed value in iteration
v_init v_e_init Initial employed value

This brings Job Search II in line with Job Search III, where the convention is:

  • v_e(w) = value of being employed at wage w
  • v_u(w) = value of being unemployed with current offer w

The subscript naming (e for employed, u for unemployed) is more intuitive than using v and h, especially for students learning these models for the first time.

Simplified the solution method by solving for v_e(w) in closed form as a
function of d, then substituting into the equation for d. This reduces the
problem from iterating on both a vector (v_e) and scalar (d) to iterating
on just the scalar d.

Key improvements:
- Added derivation showing v_e(w) = (u(w) + βαd) / (1 - β(1-α))
- Reduced to single scalar fixed-point equation for d
- Simplified code: now only iterate on scalar d instead of vector + scalar
- Compute v_e from d using closed-form expression after convergence
- More efficient: fewer variables to track during iteration
- Clearer mathematical structure

The implementation now directly reflects the simplified mathematical approach,
making it easier to understand and computationally more efficient.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jstac
Copy link
Contributor Author

jstac commented Nov 10, 2025

Additional Simplification: Single Scalar Equation

I've added a further simplification to the solution method. By solving for $v_e(w)$ in closed form as a function of $d$:

$$v_e(w) = \frac{u(w) + \beta\alpha d}{1 - \beta(1-\alpha)}$$

we can substitute this into the equation for $d$ to obtain a single scalar fixed-point equation:

$$d = \sum_{w'} \max \left[ \frac{u(w') + \beta\alpha d}{1 - \beta(1-\alpha)}, , u(c) + \beta d \right] q(w')$$

Benefits

Mathematical clarity:

  • Reduces the problem from a system of equations to a single scalar equation
  • The structure is now clearer: iterate on $d$ until convergence, then compute $v_e$

Computational efficiency:

  • Only track one scalar during iteration instead of a vector + scalar
  • Fewer state variables in the while loop
  • Direct computation of $v_e$ from $d$ using the closed form

Pedagogical improvement:

  • Shows students how to exploit problem structure
  • Demonstrates the power of algebraic manipulation before coding
  • Implementation now directly mirrors the simplified mathematics

The code has been tested and produces the same results as the previous approach.

- Changed "jitted class" to "model class" (Model is a NamedTuple, not jitted)
- Fixed indentation from 2 spaces to standard 4 spaces

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link

📖 Netlify Preview Ready!

Preview URL: https://pr-686--sunny-cactus-210e3e.netlify.app (1fad734)

📚 Changed Lecture Pages: mccall_model_with_separation

Only kept @jax.jit on top-level user-facing functions (solve_model and
compute_reservation_wage). Removed it from intermediate functions (u,
compute_v_e, update_d) since they are automatically compiled when called
from jitted functions.

Benefits:
- Cleaner code with less decorator clutter
- Avoids redundant compilation overhead
- Follows JAX best practices of jitting at the top level

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link

📖 Netlify Preview Ready!

Preview URL: https://pr-686--sunny-cactus-210e3e.netlify.app (ff39fee)

📚 Changed Lecture Pages: mccall_model_with_separation

@github-actions
Copy link

📖 Netlify Preview Ready!

Preview URL: https://pr-686--sunny-cactus-210e3e.netlify.app (269eb49)

📚 Changed Lecture Pages: mccall_model_with_separation

@github-actions
Copy link

📖 Netlify Preview Ready!

Preview URL: https://pr-686--sunny-cactus-210e3e.netlify.app (40fa336)

📚 Changed Lecture Pages: mccall_model_with_separation

@jstac jstac merged commit b61b30e into main Nov 10, 2025
1 check passed
@jstac jstac deleted the mcc_e2 branch November 10, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant