GitHub

@@ -362,8 +362,9 @@ the worker cannot change careers without changing jobs.

362362363363

## Exercises

364364365-

(career_ex1)=

366-

### Exercise 1

365+

```{exercise-start}

366+

:label: career_ex1

367+

```

367368368369

Using the default parameterization in the class `CareerWorkerProblem`,

369370

generate and plot typical sample paths for $\theta$ and $\epsilon$

@@ -372,13 +373,16 @@ when the worker follows the optimal policy.

372373

In particular, modulo randomness, reproduce the following figure (where the horizontal axis represents time)

373374374375

```{figure} /_static/lecture_specific/career/career_solutions_ex1_py.png

375-376376

```

377377378378

Hint: To generate the draws from the distributions $F$ and $G$, use `quantecon.random.draw()`.

379379380-

(career_ex2)=

381-

### Exercise 2

380+

```{exercise-end}

381+

```

382+383+384+

```{exercise}

385+

:label: career_ex2

382386383387

Let's now consider how long it takes for the worker to settle down to a

384388

permanent job, given a starting point of $(\theta, \epsilon) = (0, 0)$.

@@ -402,16 +406,21 @@ $$

402406

Collect 25,000 draws of this random variable and compute the median (which should be about 7).

403407404408

Repeat the exercise with $\beta=0.99$ and interpret the change.

409+

```

410+405411406-

(career_ex3)=

407-

### Exercise 3

412+

```{exercise}

413+

:label: career_ex3

408414409415

Set the parameterization to `G_a = G_b = 100` and generate a new optimal policy

410416

figure -- interpret.

417+

```

411418412419

## Solutions

413420414-

### Exercise 1

421+

```{solution-start} career_ex1

422+

:class: dropdown

423+

```

415424416425

Simulate job/career paths.

417426

@@ -455,7 +464,13 @@ plt.legend()

455464

plt.show()

456465

```

457466458-

### Exercise 2

467+

```{solution-end}

468+

```

469+470+471+

```{solution-start} career_ex2

472+

:class: dropdown

473+

```

459474460475

The median for the original parameterization can be computed as follows

461476

@@ -498,7 +513,13 @@ The medians are subject to randomness but should be about 7 and 14 respectively.

498513499514

Not surprisingly, more patient workers will wait longer to settle down to their final job.

500515501-

### Exercise 3

516+

```{solution-end}

517+

```

518+519+520+

```{solution-start} career_ex3

521+

:class: dropdown

522+

```

502523503524

```{code-cell} python3

504525

cw = CareerWorkerProblem(G_a=100, G_b=100)

@@ -522,3 +543,6 @@ In the new figure, you see that the region for which the worker

522543

stays put has grown because the distribution for $\epsilon$

523544

has become more concentrated around the mean, making high-paying jobs

524545

less realistic.

546+547+

```{solution-end}

548+

```

Read the original on github.com ↗