Skip to content

Commit f336eee

Browse files
jstacclaude
andcommitted
Improve mccall_model_with_sep_markov.md: Add ergodic property explanation and fix exercise format
This commit enhances the lecture with two key improvements: 1. **Added comprehensive ergodic property section**: Explains why time-average unemployment equals cross-sectional unemployment rate - Clarifies the joint Markov chain (s_t, w_t) structure - Establishes irreducibility and aperiodicity properties - Invokes the Ergodic Theorem to justify equivalence - Provides intuition for why both simulation approaches work 2. **Fixed exercise format**: Converted to proper MyST directives - Changed from plain markdown headers to {exercise-start}/{exercise-end} blocks - Added solution dropdown using {solution-start}/{solution-end} with :class: dropdown - Added label 🏷️ mmwsm_ex1 for cross-referencing - Removed filler "Solution below!" code block These changes improve pedagogical clarity and align the lecture with QuantEcon formatting standards. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 8fb1683 commit f336eee

File tree

1 file changed

+60
-6
lines changed

1 file changed

+60
-6
lines changed

lectures/mccall_model_with_sep_markov.md

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,53 @@ with job separation, showing how workers optimally balance the trade-off between
494494
accepting current offers versus waiting for better opportunities.
495495

496496

497+
## The Ergodic Property
498+
499+
Before we examine cross-sectional unemployment, it's important to understand why
500+
the time-average unemployment rate (fraction of time spent unemployed) equals the
501+
cross-sectional unemployment rate (fraction of agents unemployed at any given time).
502+
503+
The employment dynamics in this model are governed by a **joint Markov chain** $(s_t, w_t)$ where:
504+
505+
- $s_t \in \{\text{employed}, \text{unemployed}\}$ is the employment status
506+
- $w_t \in \{1, 2, \ldots, n\}$ is the wage index (current offer if unemployed, current wage if employed)
507+
508+
This joint process is Markovian because:
509+
510+
- The wage process $\{w_t\}$ evolves according to the transition matrix $P$ (independent of employment status)
511+
- Employment status transitions depend only on the current state $(s_t, w_t)$ and the reservation wage policy $\sigma$
512+
513+
The joint chain $(s_t, w_t)$ has two crucial properties:
514+
515+
1. **Irreducibility**: From any (status, wage) pair, an agent can eventually reach any other (status, wage) pair. This holds because:
516+
- Unemployed agents can become employed by accepting offers
517+
- Employed agents can become unemployed through separation (probability $\alpha$)
518+
- The wage process can transition between all wage states (assuming $P$ is irreducible)
519+
520+
2. **Aperiodicity**: At any time, there's positive probability of remaining in the current state, so there's no cyclical pattern forcing returns at fixed intervals.
521+
522+
These properties ensure the chain is **ergodic** with a unique stationary distribution $\pi$ over states $(s, w)$.
523+
524+
For an ergodic Markov chain, the **Ergodic Theorem** guarantees:
525+
526+
**Time average = Ensemble average**
527+
528+
The fraction of time a single agent spends unemployed (across all wage states) converges to the cross-sectional unemployment rate:
529+
530+
$$
531+
\lim_{T \to \infty} \frac{1}{T} \sum_{t=1}^{T} \mathbb{1}\{s_t = \text{unemployed}\} = \sum_{w=1}^{n} \pi(\text{unemployed}, w)
532+
$$
533+
534+
This holds regardless of initial conditions—whether an agent starts employed or unemployed, they converge to the same long-run distribution.
535+
536+
This is why we can study steady-state unemployment either by:
537+
538+
- Following one agent for a long time (time average), or
539+
- Observing many agents at a single point in time (cross-sectional average)
540+
541+
Both approaches yield the same steady-state unemployment rate.
542+
543+
497544
## Cross-Sectional Analysis
498545

499546
Now let's simulate many agents simultaneously to examine the cross-sectional unemployment rate:
@@ -641,17 +688,21 @@ model_low_c = create_js_with_sep_model(c=0.5)
641688
plot_cross_sectional_unemployment(model_low_c)
642689
```
643690

644-
## Exercise
691+
## Exercises
692+
693+
```{exercise-start}
694+
:label: mmwsm_ex1
695+
```
645696

646697
Create a plot that shows how the steady state cross-sectional unemployment rate
647698
changes with unemployment compensation.
648699

649-
```{code-cell} ipython3
650-
for _ in range(20):
651-
print('Solution below!')
700+
```{exercise-end}
652701
```
653702

654-
## Solution
703+
```{solution-start} mmwsm_ex1
704+
:class: dropdown
705+
```
655706

656707
```{code-cell} ipython3
657708
c_values = 1.0, 0.8, 0.6, 0.4, 0.2
@@ -663,10 +714,13 @@ for c in c_values:
663714
664715
fig, ax = plt.subplots()
665716
ax.plot(
666-
c_values, rates, alpha=0.8,
717+
c_values, rates, alpha=0.8,
667718
linewidth=1.5, label=f'Unemployment rate at c={c}'
668719
)
669720
ax.legend(frameon=False)
670721
plt.show()
671722
```
672723

724+
```{solution-end}
725+
```
726+

0 commit comments

Comments
 (0)