GitHub

@@ -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]

363637-

!pip install quantecon

37+

!pip install quantecon jax myst-nb

3838

```

39394040

## Overview

@@ -65,7 +65,7 @@ from quantecon.distributions import BetaBinomial

6565

from myst_nb import glue

6666

```

676768-

## The Model

68+

## The model

69697070

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$.

94949595

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

969697-

### Timing and Decisions

97+

### Timing and decisions

98989999

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

```

120120121-

## Solving the Model

121+

## Solving the model

122122123123

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.

136136137137138-

### The Bellman Equations

138+

### The Bellman equations

139139140140

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.

201201202202203-

### The Reservation Wage

203+

### The reservation wage

204204205205206206

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`.

235235236236237-

### Set Up

237+

### Set up

238238239239

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(

337337338338339339340-

### Computing the Reservation Wage

340+

### Computing the reservation wage

341341342342

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.

390390391391392392

(ast_mcm)=

393-

## A Simplifying Transformation

393+

## A simplifying transformation

394394395395

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.

429429430430431-

### Simplifying to a Single Equation

431+

### Simplifying to a single equation

432432433433

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.

486486487487488-

### Solving the Bellman Equations

488+

### Solving the Bellman equations

489489490490

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.

596596597597598-

## Impact of Parameters

598+

## Impact of parameters

599599600600

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

601601602-

### The Reservation Wage and Unemployment Compensation

602+

### The reservation wage and unemployment compensation

603603604604

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

615615616616

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

617617618-

### The Reservation Wage and Discounting

618+

### The reservation wage and discounting

619619620620

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

621621

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

629629630630

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

631631632-

### The Reservation Wage and Job Destruction

632+

### The reservation wage and job destruction

633633634634

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)

682682683683

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)

700700701701

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)

718718719719

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()

Read the original on github.com ↗