File tree Expand file tree Collapse file tree 1 file changed +0
-36
lines changed Expand file tree Collapse file tree 1 file changed +0
-36
lines changed Original file line number Diff line number Diff line change @@ -1113,42 +1113,6 @@ mc = qe.MarkovChain(P)
1113
1113
ψ_star
1114
1114
```
1115
1115
1116
- Solution 3:
1117
-
1118
- We find the distribution $\psi$ converges to the stationary distribution more quickly compared to the {ref}` hamilton's chain <hamilton> ` .
1119
-
1120
- ``` {code-cell} ipython3
1121
- ts_length = 10
1122
- num_distributions = 25
1123
- plot_distribution(P, ts_length, num_distributions)
1124
- ```
1125
-
1126
- In fact, the rate of convergence is governed by {ref}` eigenvalues<eigen> ` {cite}` sargent2023economic ` .
1127
-
1128
- ``` {code-cell} ipython3
1129
- P_eigenvals = np.linalg.eigvals(P)
1130
- P_eigenvals
1131
- ```
1132
-
1133
- ``` {code-cell} ipython3
1134
- P_hamilton = np.array([[0.971, 0.029, 0.000],
1135
- [0.145, 0.778, 0.077],
1136
- [0.000, 0.508, 0.492]])
1137
-
1138
- hamilton_eigenvals = np.linalg.eigvals(P_hamilton)
1139
- hamilton_eigenvals
1140
- ```
1141
-
1142
- More specifically, it is governed by the spectral gap, the difference between the largest and the second largest eigenvalue.
1143
-
1144
- ``` {code-cell} ipython3
1145
- sp_gap_P = P_eigenvals[0] - np.diff(P_eigenvals)[0]
1146
- sp_gap_hamilton = hamilton_eigenvals[0] - np.diff(hamilton_eigenvals)[0]
1147
-
1148
- sp_gap_P > sp_gap_hamilton
1149
- ```
1150
-
1151
- We will come back to this when we discuss {ref}` spectral theory<spec_markov> ` .
1152
1116
1153
1117
``` {solution-end}
1154
1118
```
You can’t perform that action at this time.
0 commit comments