@@ -107,8 +107,6 @@ From US unemployment data, Hamilton {cite}`Hamilton2005` estimated the followin
107
107
108
108
```
109
109
110
- +++
111
-
112
110
Here there are three ** states**
113
111
114
112
* "ng" represents normal growth
@@ -294,7 +292,7 @@ Looking at the data, we see that democracies tend to have longer-lasting growth
294
292
regimes compared to autocracies (as indicated by the lower probability of
295
293
transitioning from growth to growth in autocracies).
296
294
297
- We can also find a higher probability from collapse to growth in democratic regimes
295
+ We can also find a higher probability from collapse to growth in democratic regimes.
298
296
299
297
300
298
### Defining Markov chains
@@ -411,7 +409,6 @@ def mc_sample_path(P, ψ_0=None, ts_length=1_000):
411
409
X = np.empty(ts_length, dtype=int)
412
410
413
411
# Convert each row of P into a cdf
414
- n = len(P)
415
412
P_dist = np.cumsum(P, axis=1) # Convert rows into cdfs
416
413
417
414
# draw initial state, defaulting to 0
@@ -683,7 +680,7 @@ P = np.array([[0.4, 0.6],
683
680
ψ @ P
684
681
```
685
682
686
- Notice that ` ψ @ P ` is the same as ` ψ `
683
+ Notice that ` ψ @ P ` is the same as ` ψ ` .
687
684
688
685
689
686
@@ -772,11 +769,11 @@ For example, we have the following result
772
769
(strict_stationary)=
773
770
``` {prf:theorem}
774
771
Theorem: If there exists an integer $m$ such that all entries of $P^m$ are
775
- strictly positive, with unique stationary distribution $\psi^*$, and
772
+ strictly positive, with unique stationary distribution $\psi^*$, then
776
773
777
774
$$
778
775
\psi_0 P^t \to \psi^*
779
- \quad \text{as } t \to \infty
776
+ \quad \text{ as } t \to \infty
780
777
$$
781
778
```
782
779
@@ -837,8 +834,6 @@ ax.scatter(ψ_star[0], ψ_star[1], ψ_star[2], c='k', s=60)
837
834
plt.show()
838
835
```
839
836
840
- +++ {"user_expressions": [ ] , "tags": [ ] }
841
-
842
837
Here
843
838
844
839
* $P$ is the stochastic matrix for recession and growth {ref}` considered above <mc_eg2> ` .
@@ -1083,8 +1078,6 @@ Solution 1:
1083
1078
1084
1079
```
1085
1080
1086
- +++
1087
-
1088
1081
Since the matrix is everywhere positive, there is a unique stationary distribution.
1089
1082
1090
1083
Solution 2:
0 commit comments