@@ -594,6 +594,7 @@ def tree_price(ap):
594594 I = np.identity(ap.n)
595595 Ones = np.ones(ap.n)
596596 v = solve(I - β * J, β * J @ Ones)
597+ v = solve(I - β * J, J @ Full)
597598
598599 return v
599600```
@@ -723,6 +724,7 @@ def consol_price(ap, ζ):
723724 I = np.identity(ap.n)
724725 Ones = np.ones(ap.n)
725726 p = solve(I - β * M, β * ζ * M @ Ones)
727+ p = solve(I - β * M, M @ Full)
726728
727729 return p
728730```
@@ -923,7 +925,7 @@ Consider the following primitives
923925``` {code-cell} python3
924926n = 5
925927P = np.full((n, n), 0.0125)
926- P += np.diag(0.95 - 0.0125 * np.ones(5) )
928+ P[range(n), range(n)] += 1 - P.sum(1 )
927929# State values of the Markov chain
928930s = np.array([0.95, 0.975, 1.0, 1.025, 1.05])
929931γ = 2.0
@@ -1011,7 +1013,7 @@ First, let's enter the parameters:
10111013``` {code-cell} python3
10121014n = 5
10131015P = np.full((n, n), 0.0125)
1014- P += np.diag(0.95 - 0.0125 * np.ones(5) )
1016+ P[range(n), range(n)] += 1 - P.sum(1 )
10151017s = np.array([0.95, 0.975, 1.0, 1.025, 1.05]) # State values
10161018mc = qe.MarkovChain(P, state_values=s)
10171019
0 commit comments