Skip to content

Commit 1739697

Browse files
committed
add metadata cell for figures
1 parent 0317e4a commit 1739697

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

lectures/markov_asset.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,13 @@ The next figure shows a simulation, where
324324
* $g_t = \exp(X_t)$, so that $\ln g_t = X_t$ is the growth rate.
325325

326326
```{code-cell} ipython3
327+
---
328+
mystnb:
329+
figure:
330+
caption: |
331+
State, growth, and dividend simulation
332+
name: fig_markov_sim
333+
---
327334
n = 7
328335
mc = qe.tauchen(n, 0.96, 0.25)
329336
sim_length = 80
@@ -414,6 +421,13 @@ As before, we'll generate $\{X_t\}$ as a {ref}`discretized AR1 process <fm_ex3>
414421
Here's the code, including a test of the spectral radius condition
415422

416423
```{code-cell} ipython3
424+
---
425+
mystnb:
426+
figure:
427+
caption: |
428+
Price-dividend ratio risk-neutral case
429+
name: fig_pdv_neutral
430+
---
417431
n = 25 # Size of state space
418432
β = 0.9
419433
mc = qe.tauchen(n, 0.96, 0.02)
@@ -633,6 +647,13 @@ Here's a plot of $v$ as a function of the state for several values of $\gamma$,
633647
with a positively correlated Markov process and $g(x) = \exp(x)$
634648
635649
```{code-cell} ipython3
650+
---
651+
mystnb:
652+
figure:
653+
caption: |
654+
Lucas tree prices for varying risk aversion
655+
name: fig_lucas_gamma
656+
---
636657
γs = [1.2, 1.4, 1.6, 1.8, 2.0]
637658
ap = create_ap_model()
638659
states = ap.mc.state_values
@@ -644,7 +665,6 @@ for γ in γs:
644665
v = tree_price(tem_ap)
645666
ax.plot(states, v, lw=2, alpha=0.6, label=rf"$\gamma = {γ}$")
646667
647-
ax.set_title('Price-dividend ratio as a function of the state')
648668
ax.set_ylabel("price-dividend ratio")
649669
ax.set_xlabel("state")
650670
ax.legend(loc='upper right')
@@ -887,6 +907,13 @@ def call_option(ap, ζ, p_s, ϵ=1e-7):
887907
Here's a plot of $w$ compared to the consol price when $P_S = 40$
888908
889909
```{code-cell} ipython3
910+
---
911+
mystnb:
912+
figure:
913+
caption: |
914+
Consol price and call option value
915+
name: fig_consol_call
916+
---
890917
ap = create_ap_model(β=0.9)
891918
ζ = 1.0
892919
strike_price = 40
@@ -1055,6 +1082,13 @@ call_option(apm, ζ, p_s)
10551082
Let's show the last two functions as a plot
10561083
10571084
```{code-cell} ipython3
1085+
---
1086+
mystnb:
1087+
figure:
1088+
caption: |
1089+
Consol and call option exercise two comparison
1090+
name: fig_ex2_prices
1091+
---
10581092
fig, ax = plt.subplots()
10591093
ax.plot(s, consol_price(apm, ζ), label='consol')
10601094
ax.plot(s, call_option(apm, ζ, p_s), label='call option')
@@ -1141,7 +1175,14 @@ def finite_horizon_call_option(ap, ζ, p_s, k):
11411175
11421176
Now let's compute the option values at `k=5` and `k=25`
11431177
1144-
```{code-cell} python3
1178+
```{code-cell} ipython3
1179+
---
1180+
mystnb:
1181+
figure:
1182+
caption: |
1183+
Finite horizon call option values
1184+
name: fig_ex3_finite
1185+
---
11451186
fig, ax = plt.subplots()
11461187
for k in [5, 25]:
11471188
w = finite_horizon_call_option(apm, ζ, p_s, k)

0 commit comments

Comments
 (0)