Skip to content

Commit 1f23a64

Browse files
authored
[markov_markov_II] Fix prf:theorem in markov_chains_II (#556)
* fix `prf:theorem` in markov_chains_II * fix a small bug in indexing for prob_dist
1 parent 655a9fc commit 1f23a64

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

lectures/markov_chains_II.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ that
7171
The stochastic matrix $P$ is called **irreducible** if all states communicate;
7272
that is, if $x$ and $y$ communicate for all $(x, y)$ in $S \times S$.
7373

74-
```{prf:example}
74+
````{prf:example}
7575
:label: mc2_ex_ir
7676
For example, consider the following transition probabilities for wealth of a
7777
fictitious set of households
@@ -81,8 +81,6 @@ fictitious set of households
8181
:align: center
8282
```
8383
84-
85-
8684
We can translate this into a stochastic matrix, putting zeros where
8785
there's no edge between nodes
8886
@@ -97,7 +95,7 @@ $$
9795
9896
It's clear from the graph that this stochastic matrix is irreducible: we can eventually
9997
reach any state from any other state.
100-
```
98+
````
10199

102100
We can also test this using [QuantEcon.py](http://quantecon.org/quantecon-py)'s MarkovChain class
103101

@@ -110,7 +108,7 @@ mc = qe.MarkovChain(P, ('poor', 'middle', 'rich'))
110108
mc.is_irreducible
111109
```
112110

113-
```{prf:example}
111+
````{prf:example}
114112
:label: mc2_ex_pf
115113
116114
Here's a more pessimistic scenario in which poor people remain poor forever
@@ -122,7 +120,7 @@ Here's a more pessimistic scenario in which poor people remain poor forever
122120
123121
This stochastic matrix is not irreducible since, for example, rich is not
124122
accessible from poor.
125-
```
123+
````
126124

127125
Let's confirm this
128126

@@ -279,7 +277,7 @@ In any of these cases, ergodicity will hold.
279277

280278
### Example: a periodic chain
281279

282-
```{prf:example}
280+
````{prf:example}
283281
:label: mc2_ex_pc
284282
285283
Let's look at the following example with states 0 and 1:
@@ -301,7 +299,8 @@ The transition graph shows that this model is irreducible.
301299
```
302300
303301
Notice that there is a periodic cycle --- the state cycles between the two states in a regular way.
304-
```
302+
````
303+
305304
Not surprisingly, this property
306305
is called [periodicity](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_(Siegrist)/16%3A_Markov_Processes/16.05%3A_Periodicity_of_Discrete-Time_Chains).
307306

lectures/prob_dist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ x_costco = prices.pct_change()[1:] * 100
882882

883883
```{code-cell} ipython3
884884
fig, ax = plt.subplots()
885-
ax.violinplot([x_amazon, x_costco])
885+
ax.violinplot([x_amazon['AMZN'], x_costco['COST']])
886886
ax.set_ylabel('monthly return (percent change)')
887887
ax.set_xlabel('retailers')
888888

0 commit comments

Comments
 (0)