You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
Update made to Markov Chains: Basic Concepts lecture (#479)
* Update made to Markov Chains: Basic Concepts lecture
* update to markov chain I lecture
* cross-sectional frequency explaination added
* change prf to ref
* [markov_chain_I] Move example subsections to sphinx-proof examples
* minor update
* fix syntax for example
* final update to usage of syntax for example
* removing an error
* Fix minor typos in markov_chains_I
- Add missing space: "distribution(probability mass function)"
→ "distribution (probability mass function)"
- Fix label typo: prob-recesession → prob-recession
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Restore animation description and add label to third prf:example
- Revert the description of the 3D simplex animation back to its
original form. The PR had rewritten it to describe a single ψ₀
in red with a black stationary distribution, but the actual
animation code (lines 845-882) still plots three distributions
(blue, red, green) with the stationary distribution in yellow.
Restoring the description so it matches the figure.
- Add 🏷️ to the Steady-State Unemployment Probability example
for consistency with the other two prf:example blocks.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: mmcky <mamckay@gmail.com>
Co-authored-by: Matt McKay <mmcky@users.noreply.github.com>
Co-authored-by: John Stachurski <john.stachurski@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The distributions we have been studying can be viewed either
633
651
634
652
1. as probabilities or
635
-
1. as cross-sectional frequencies that the law of large numbers leads us to anticipate for large samples.
653
+
2. as cross-sectional frequencies that the law of large numbers leads us to anticipate for large samples.
636
654
637
-
To illustrate, recall our model of employment/unemployment dynamics for a given worker {ref}`discussed above <mc_eg1>`.
655
+
To illustrate, recall our model of employment/unemployment dynamics for a given worker discussed in {ref}`Example 2: Unemployment <mc_eg1>`.
638
656
639
-
Consider a large population of workers, each of whose lifetime experience is
640
-
described by the specified dynamics, with each worker's outcomes being
641
-
realizations of processes that are statistically independent of all other
642
-
workers' processes.
657
+
Consider a large population of workers, each of whose lifetime experience is described by the specified dynamics, with each worker's outcomes being realizations of processes that are statistically independent of all other workers' processes.
643
658
644
659
Let $\psi_t$ be the current *cross-sectional* distribution over $\{ 0, 1 \}$.
645
660
@@ -649,26 +664,25 @@ The cross-sectional distribution records fractions of workers employed and unemp
649
664
650
665
What will the cross-sectional distribution be in 10 periods hence?
651
666
652
-
The answer is $\psi_t P^{10}$, where $P$ is the stochastic matrix in
653
-
{eq}`p_unempemp`.
667
+
The answer is $\psi_t P^{10}$, where $P$ is the stochastic matrix in {eq}`p_unempemp`.
654
668
655
-
This is because each worker's state evolves according to $P$, so
656
-
$\psi_t P^{10}$ is a [marginal distribution](https://en.wikipedia.org/wiki/Marginal_distribution) for a single randomly selected
657
-
worker.
669
+
This is because each worker's state evolves according to $P$, so $\psi_t P^{10}$ is a [marginal distribution](https://en.wikipedia.org/wiki/Marginal_distribution) for a single randomly selected worker.
658
670
659
-
But when the sample is large, outcomes and probabilities are roughly equal (by an application of the law
660
-
of large numbers).
671
+
But when the sample is large, outcomes and probabilities are roughly equal (by an application of the law of large numbers).
661
672
662
-
So for a very large (tending to infinite) population,
663
-
$\psi_t P^{10}$ also represents fractions of workers in
664
-
each state.
673
+
So for a very large (tending to infinite) population, $\psi_t P^{10}$ also represents fractions of workers in each state.
665
674
666
675
This is exactly the cross-sectional distribution.
667
676
677
+
```{note}
678
+
A cross-sectional frequency measures how a particular variable (e.g., employment status) is distributed across a population at a specific time, providing information on the proportions of individuals in each possible state of that variable.
679
+
```
680
+
681
+
````
682
+
668
683
(stationary)=
669
684
## Stationary distributions
670
685
671
-
672
686
As seen in {eq}`fin_mc_fr`, we can shift a distribution forward one
673
687
unit of time via postmultiplication by $P$.
674
688
@@ -683,8 +697,6 @@ P = np.array([[0.4, 0.6],
683
697
684
698
Notice that `ψ @ P` is the same as `ψ`.
685
699
686
-
687
-
688
700
Such distributions are called **stationary** or **invariant**.
689
701
690
702
(mc_stat_dd)=
@@ -725,10 +737,10 @@ distribution.
725
737
We will come back to this when we introduce irreducibility in the {doc}`next lecture <markov_chains_II>` on Markov chains.
726
738
727
739
740
+
```{prf:example} Steady-State Unemployment Probability
741
+
:label: steady-state-unemployment
728
742
729
-
### Example
730
-
731
-
Recall our model of the employment/unemployment dynamics of a particular worker {ref}`discussed above <mc_eg1>`.
743
+
Recall our model of the employment/unemployment dynamics of a particular worker discussed in {ref}`Example 2: Unemployment <mc_eg1>`.
732
744
733
745
If $\alpha \in (0,1)$ and $\beta \in (0,1)$, then the transition matrix is everywhere positive.
734
746
@@ -738,12 +750,13 @@ corresponds to unemployment (state 0).
738
750
Using $\psi^* = \psi^* P$ and a bit of algebra yields
739
751
740
752
$$
741
-
p = \frac{\beta}{\alpha + \beta}
753
+
p = \frac{\beta}{\alpha + \beta}
742
754
$$
743
755
744
756
This is, in some sense, a steady state probability of unemployment.
745
757
746
758
Not surprisingly it tends to zero as $\beta \to 0$, and to one as $\alpha \to 0$.
759
+
```
747
760
748
761
749
762
@@ -879,9 +892,9 @@ HTML(anim.to_jshtml())
879
892
880
893
Here
881
894
882
-
* $P$ is the stochastic matrix for recession and growth {ref}`considered above <mc_eg2>`.
883
-
* The red, blue and green dots are initial marginal probability distributions $\psi_1, \psi_2, \psi_3$, each of which is represented as a vector in $\mathbb R^3$.
884
-
* The transparent dots are the marginal distributions $\psi_i P^t$ for $t = 1, 2, \ldots$, for $i=1,2,3.$.
895
+
* $P$ is the stochastic matrix for recession and growth considered in {ref}`Example 1: Economic states <mc_eg2>`.
896
+
* The red, blue and green dots are initial marginal probability distributions $\psi_1, \psi_2, \psi_3$, each of which is represented as a vector in $\mathbb R^3$.
897
+
* The transparent dots are the marginal distributions $\psi_i P^t$ for $t = 1, 2, \ldots$, for $i=1,2,3.$
885
898
* The yellow dot is $\psi^*$.
886
899
887
900
You might like to try experimenting with different initial conditions.
0 commit comments