Skip to content

Commit d1d868c

Browse files
[mccall_model_with_separation] Update Exercises into Discussions (#701)
* update exercises * Update lectures/mccall_model_with_separation.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * revert changes but add stylesheet compliance enforcement --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f62707f commit d1d868c

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

lectures/mccall_model_with_separation.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ In addition to what's in Anaconda, this lecture will need the following librarie
3434
```{code-cell} ipython3
3535
:tags: [hide-output]
3636
37-
!pip install quantecon
37+
!pip install quantecon jax myst-nb
3838
```
3939

4040
## Overview
@@ -65,7 +65,7 @@ from quantecon.distributions import BetaBinomial
6565
from myst_nb import glue
6666
```
6767

68-
## The Model
68+
## The model
6969

7070
The model is similar to the {doc}`baseline McCall job search model <mccall_model>`.
7171

@@ -94,7 +94,7 @@ Wage offers $\{ W_t \}$ are IID with common distribution $q$.
9494

9595
The set of possible wage values is denoted by $\mathbb W$.
9696

97-
### Timing and Decisions
97+
### Timing and decisions
9898

9999
At the start of each period, the agent can be either
100100

@@ -118,7 +118,7 @@ The process then repeats.
118118
We do not allow for job search while employed---this topic is taken up in a {doc}`later lecture <jv>`.
119119
```
120120

121-
## Solving the Model
121+
## Solving the model
122122

123123
We drop time subscripts in what follows and primes denote next period values.
124124

@@ -135,7 +135,7 @@ the worker makes optimal decisions at all future points in time.
135135
As we now show, obtaining these functions is key to solving the model.
136136

137137

138-
### The Bellman Equations
138+
### The Bellman equations
139139

140140
We recall that, in {doc}`the original job search model <mccall_model>`, the
141141
value function (the value of being unemployed with a given wage offer) satisfied
@@ -200,7 +200,7 @@ enough information to solve for both $v_e$ and $v_u$.
200200
Once we have them in hand, we will be able to make optimal choices.
201201

202202

203-
### The Reservation Wage
203+
### The reservation wage
204204

205205

206206
Let
@@ -234,7 +234,7 @@ Let's now implement a solution method based on the two Bellman equations
234234
{eq}`bell2_mccall` and {eq}`bell1_mccall`.
235235

236236

237-
### Set Up
237+
### Set up
238238

239239
The default utility function is a CRRA utility function
240240

@@ -310,8 +310,8 @@ than some small tolerance level.
310310
```{code-cell} ipython3
311311
def solve_full_model(
312312
model,
313-
tol: float=1e-6,
314-
max_iter: int=1_000,
313+
tol: float = 1e-6,
314+
max_iter: int = 1_000,
315315
):
316316
"""
317317
Solves for both value functions v_u and v_e iteratively.
@@ -337,7 +337,7 @@ def solve_full_model(
337337

338338

339339

340-
### Computing the Reservation Wage
340+
### Computing the reservation wage
341341

342342
Now that we can solve for both value functions, let's investigate the reservation wage.
343343

@@ -390,7 +390,7 @@ This value seems close to where the two lines meet.
390390

391391

392392
(ast_mcm)=
393-
## A Simplifying Transformation
393+
## A simplifying transformation
394394

395395
The approach above works, but iterating over two vector-valued functions is computationally expensive.
396396

@@ -428,7 +428,7 @@ useful.
428428
But we can go further, but eliminating $v_e$ from the above equation.
429429

430430

431-
### Simplifying to a Single Equation
431+
### Simplifying to a single equation
432432

433433
As a first step, we rearrange the expression defining $h$ (see {eq}`defh_mm`) to obtain
434434

@@ -485,7 +485,7 @@ If we can solve this for $h$, we can easily recover $v_e$ using
485485
Then we have enough information to compute the reservation wage.
486486

487487

488-
### Solving the Bellman Equations
488+
### Solving the Bellman equations
489489

490490
To solve {eq}`bell_scalar`, we use the iteration rule
491491

@@ -595,11 +595,11 @@ However, the simplified method is far more efficient.
595595
Next we will investigate how the reservation wage varies with parameters.
596596

597597

598-
## Impact of Parameters
598+
## Impact of parameters
599599

600600
In each instance below, we'll show you a figure and then ask you to reproduce it in the exercises.
601601

602-
### The Reservation Wage and Unemployment Compensation
602+
### The reservation wage and unemployment compensation
603603

604604
First, let's look at how $\bar w$ varies with unemployment compensation.
605605

@@ -615,7 +615,7 @@ As expected, higher unemployment compensation causes the worker to hold out for
615615

616616
In effect, the cost of continuing job search is reduced.
617617

618-
### The Reservation Wage and Discounting
618+
### The reservation wage and discounting
619619

620620
Next, let's investigate how $\bar w$ varies with the discount factor.
621621

@@ -629,7 +629,7 @@ $\beta$
629629

630630
Again, the results are intuitive: More patient workers will hold out for higher wages.
631631

632-
### The Reservation Wage and Job Destruction
632+
### The reservation wage and job destruction
633633

634634
Finally, let's look at how $\bar w$ varies with the job separation rate $\alpha$.
635635

@@ -682,7 +682,7 @@ w_bar_vals = jax.vmap(compute_res_wage_given_c)(c_vals)
682682
683683
fig, ax = plt.subplots()
684684
ax.set(xlabel='unemployment compensation', ylabel='reservation wage')
685-
ax.plot(c_vals, w_bar_vals, label=r'$\bar w$ as a function of $c$')
685+
ax.plot(c_vals, w_bar_vals, lw=2, label=r'$\bar w$ as a function of $c$')
686686
ax.legend()
687687
glue("mccall_resw_c", fig, display=False)
688688
plt.show()
@@ -700,7 +700,7 @@ w_bar_vals = jax.vmap(compute_res_wage_given_beta)(β_vals)
700700
701701
fig, ax = plt.subplots()
702702
ax.set(xlabel='discount factor', ylabel='reservation wage')
703-
ax.plot(β_vals, w_bar_vals, label=r'$\bar w$ as a function of $\beta$')
703+
ax.plot(β_vals, w_bar_vals, lw=2, label=r'$\bar w$ as a function of $\beta$')
704704
ax.legend()
705705
glue("mccall_resw_beta", fig, display=False)
706706
plt.show()
@@ -718,7 +718,7 @@ w_bar_vals = jax.vmap(compute_res_wage_given_alpha)(α_vals)
718718
719719
fig, ax = plt.subplots()
720720
ax.set(xlabel='separation rate', ylabel='reservation wage')
721-
ax.plot(α_vals, w_bar_vals, label=r'$\bar w$ as a function of $\alpha$')
721+
ax.plot(α_vals, w_bar_vals, lw=2, label=r'$\bar w$ as a function of $\alpha$')
722722
ax.legend()
723723
glue("mccall_resw_alpha", fig, display=False)
724724
plt.show()

0 commit comments

Comments
 (0)