Skip to content

Commit a6fd5d3

Browse files
authored
FIX: Adjust for quantecon==0.6.0 (#296)
* FIX: Adjust for quantecon==0.6.0 * fix linkchecker * fix: n needs to be defined
1 parent dbec349 commit a6fd5d3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lectures/markov_asset.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ An asset is a claim on one or more future payoffs.
5353

5454
The spot price of an asset depends primarily on
5555

56-
* the anticipated income stream
56+
* the anticipated income stream
5757
* attitudes about risk
5858
* rates of time preference
5959

@@ -313,7 +313,8 @@ The next figure shows a simulation, where
313313
* $g_t = \exp(X_t)$, so that $\ln g_t = X_t$ is the growth rate.
314314

315315
```{code-cell} ipython
316-
mc = qe.tauchen(0.96, 0.25, n=25)
316+
n = 7
317+
mc = qe.tauchen(n, 0.96, 0.25)
317318
sim_length = 80
318319
319320
x_series = mc.simulate(sim_length, init=np.median(mc.state_values))
@@ -404,7 +405,7 @@ Here's the code, including a test of the spectral radius condition
404405
```{code-cell} python3
405406
n = 25 # Size of state space
406407
β = 0.9
407-
mc = qe.tauchen(0.96, 0.02, n=n)
408+
mc = qe.tauchen(n, 0.96, 0.02)
408409
409410
K = mc.P * np.exp(mc.state_values)
410411
@@ -566,7 +567,7 @@ class AssetPriceModel:
566567
if mc is None:
567568
self.ρ = 0.9
568569
self.σ = 0.02
569-
self.mc = qe.tauchen(self.ρ, self.σ, n=25)
570+
self.mc = qe.tauchen(n, self.ρ, self.σ)
570571
else:
571572
self.mc = mc
572573
@@ -962,7 +963,7 @@ $$
962963
Consider the following primitives
963964
964965
```{code-cell} python3
965-
n = 5
966+
n = 5 # Size of State Space
966967
P = np.full((n, n), 0.0125)
967968
P[range(n), range(n)] += 1 - P.sum(1)
968969
# State values of the Markov chain

lectures/mix_model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ in conjunction with the `numpy.searchsorted` command to sample from $H$ directly
236236
See <https://numpy.org/doc/stable/reference/generated/numpy.searchsorted.html> for the
237237
`searchsorted` function.
238238

239-
See the [Mr. P Solver video on Monte Carlo simulation](https://www.google.com/search?client=firefox-b-1-d&q=Mr+P+solver+Monte+Carlo#fpstate=ive&vld=cid:bdcddc9f,vid:U00Kseb6SB4) to see other applications of this powerful trick.
239+
See the [Mr. P Solver video on Monte Carlo simulation](https://www.google.com/search?q=Mr.+P+Solver+video+on+Monte+Carlo+simulation&oq=Mr.+P+Solver+video+on+Monte+Carlo+simulation) to see other applications of this powerful trick.
240240

241241
In the Python code below, we'll use both of our methods and confirm that each of them does a good job of sampling
242242
from our target mixture distribution.

0 commit comments

Comments
 (0)