Skip to content

Commit 84e7dfc

Browse files
committed
REPLICA: PR #355
1 parent e585437 commit 84e7dfc

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

lectures/lake_model.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ This class will
218218
1. store the primitives $\alpha, \lambda, b, d$
219219
1. compute and store the implied objects $g, A, \hat A$
220220
1. provide methods to simulate dynamics of the stocks and rates
221-
1. provide a method to compute the steady state of the rate
221+
1. provide a method to compute the steady state of the rate (We will discuss it in section {ref}`dynamics_workers`)
222222

223223
Please be careful because the implied objects $g, A, \hat A$ will not change
224224
if you only change the primitives.
@@ -265,12 +265,8 @@ class LakeModel:
265265
--------
266266
xbar : steady state vector of employment and unemployment rates
267267
"""
268-
x = np.full(2, 0.5)
269-
error = tol + 1
270-
while error > tol:
271-
new_x = self.A_hat @ x
272-
error = np.max(np.abs(new_x - x))
273-
x = new_x
268+
x = np.array([self.A_hat[0, 1], self.A_hat[1, 0]])
269+
x /= x.sum()
274270
return x
275271
276272
def simulate_stock_path(self, X0, T):
@@ -415,6 +411,7 @@ plt.tight_layout()
415411
plt.show()
416412
```
417413

414+
(dynamics_workers)=
418415
## Dynamics of an Individual Worker
419416

420417
An individual worker's employment dynamics are governed by a {doc}`finite state Markov process <finite_markov>`.
@@ -1016,12 +1013,8 @@ class LakeModelModified:
10161013
--------
10171014
xbar : steady state vector of employment and unemployment rates
10181015
"""
1019-
x = np.full(2, 0.5)
1020-
error = tol + 1
1021-
while error > tol:
1022-
new_x = self.A_hat @ x
1023-
error = np.max(np.abs(new_x - x))
1024-
x = new_x
1016+
x = np.array([self.A_hat[0, 1], self.A_hat[1, 0]])
1017+
x /= x.sum()
10251018
return x
10261019
10271020
def simulate_stock_path(self, X0, T):

0 commit comments

Comments
 (0)