diff --git a/lectures/markov_chains_II.md b/lectures/markov_chains_II.md index fe2ad9b3..a6237d7c 100644 --- a/lectures/markov_chains_II.md +++ b/lectures/markov_chains_II.md @@ -71,7 +71,7 @@ that The stochastic matrix $P$ is called **irreducible** if all states communicate; that is, if $x$ and $y$ communicate for all $(x, y)$ in $S \times S$. -```{prf:example} +````{prf:example} :label: mc2_ex_ir For example, consider the following transition probabilities for wealth of a fictitious set of households @@ -81,8 +81,6 @@ fictitious set of households :align: center ``` - - We can translate this into a stochastic matrix, putting zeros where there's no edge between nodes @@ -97,7 +95,7 @@ $$ It's clear from the graph that this stochastic matrix is irreducible: we can eventually reach any state from any other state. -``` +```` We can also test this using [QuantEcon.py](http://quantecon.org/quantecon-py)'s MarkovChain class @@ -110,7 +108,7 @@ mc = qe.MarkovChain(P, ('poor', 'middle', 'rich')) mc.is_irreducible ``` -```{prf:example} +````{prf:example} :label: mc2_ex_pf 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 This stochastic matrix is not irreducible since, for example, rich is not accessible from poor. -``` +```` Let's confirm this @@ -279,7 +277,7 @@ In any of these cases, ergodicity will hold. ### Example: a periodic chain -```{prf:example} +````{prf:example} :label: mc2_ex_pc 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. ``` Notice that there is a periodic cycle --- the state cycles between the two states in a regular way. -``` +```` + Not surprisingly, this property 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). diff --git a/lectures/prob_dist.md b/lectures/prob_dist.md index 22defb18..14c210c4 100644 --- a/lectures/prob_dist.md +++ b/lectures/prob_dist.md @@ -882,7 +882,7 @@ x_costco = prices.pct_change()[1:] * 100 ```{code-cell} ipython3 fig, ax = plt.subplots() -ax.violinplot([x_amazon, x_costco]) +ax.violinplot([x_amazon['AMZN'], x_costco['COST']]) ax.set_ylabel('monthly return (percent change)') ax.set_xlabel('retailers')