|
2 | 2 | from __future__ import division # Omit for Python 3.x |
3 | 3 | import numpy as np |
4 | 4 | import matplotlib.pyplot as plt |
5 | | -from quantecon.models import lucas_tree, compute_lt_price |
| 5 | +from quantecon.models import LucasTree |
6 | 6 |
|
7 | 7 | fig, ax = plt.subplots() |
8 | | -#grid = np.linspace(1e-10, 4, 100) |
9 | 8 |
|
10 | | -tree = lucas_tree(gamma=2, beta=0.95, alpha=0.90, sigma=0.1) |
11 | | -grid, price_vals = compute_lt_price(tree) |
| 9 | +tree = LucasTree(gamma=2, beta=0.95, alpha=0.90, sigma=0.1) |
| 10 | +grid, price_vals = tree.grid, tree.compute_lt_price() |
12 | 11 | ax.plot(grid, price_vals, lw=2, alpha=0.7, label=r'$p^*(y)$') |
13 | 12 | ax.set_xlim(min(grid), max(grid)) |
14 | 13 |
|
15 | | -#tree = lucas_tree(gamma=3, beta=0.95, alpha=0.90, sigma=0.1) |
16 | | -#grid, price_vals = compute_price(tree) |
17 | | -#ax.plot(grid, price_vals, lw=2, alpha=0.7, label='more patient') |
18 | | -#ax.set_xlim(min(grid), max(grid)) |
| 14 | +# tree = LucasTree(gamma=3, beta=0.95, alpha=0.90, sigma=0.1) |
| 15 | +# grid, price_vals = tree.grid, tree.compute_lt_price() |
| 16 | +# ax.plot(grid, price_vals, lw=2, alpha=0.7, label='more patient') |
| 17 | +# ax.set_xlim(min(grid), max(grid)) |
19 | 18 |
|
20 | 19 | ax.set_xlabel(r'$y$', fontsize=16) |
21 | 20 | ax.set_ylabel(r'price', fontsize=16) |
|
0 commit comments