Skip to content

Commit 11f7ca1

Browse files
committed
migrate source files from lecture-python-advanced (a595042) using sphinx-tomyst
1 parent 3c79ef3 commit 11f7ca1

19 files changed

+80
-119
lines changed

lectures/additive_functionals.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,9 +1265,11 @@ These probability density functions help us understand mechanics underlying the
12651265

12661266
### Multiplicative Martingale as Likelihood Ratio Process
12671267

1268-
{doc}`This lecture <likelihood_ratio_process>` studies **likelihood processes** and **likelihood ratio processes**.
1268+
[This lecture](https://python.quantecon.org/likelihood_ratio_process.html) studies **likelihood processes**
1269+
and **likelihood ratio processes**.
12691270

12701271
A **likelihood ratio process** is a multiplicative martingale with mean unity.
12711272

1272-
Likelihood ratio processes exhibit the peculiar property that naturally also appears in {doc}`this lecture <likelihood_ratio_process>`.
1273+
Likelihood ratio processes exhibit the peculiar property that naturally also appears
1274+
[here](https://python.quantecon.org/likelihood_ratio_process.html).
12731275

lectures/amss.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,6 @@ kernelspec:
2424
:depth: 2
2525
```
2626

27-
**Software Requirement:**
28-
29-
This lecture requires the use of some older software versions to run. If
30-
you would like to execute this lecture please download the following
31-
<a href=_static/downloads/amss_environment.yml download>amss_environment.yml</a>
32-
file. This specifies the software required and an environment can be
33-
created using [conda](https://docs.conda.io/en/latest/):
34-
35-
Open a terminal:
36-
37-
```{code-block} bash
38-
conda env create --file amss_environment.yml
39-
conda activate amss
40-
```
41-
4227
In addition to what's in Anaconda, this lecture will need the following libraries:
4328

4429
```{code-cell} ipython

lectures/amss2.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,6 @@ kernelspec:
2424
:depth: 2
2525
```
2626

27-
**Software Requirement:**
28-
29-
This lecture requires the use of some older software versions to run. If
30-
you would like to execute this lecture please download the following
31-
<a href=_static/downloads/amss_environment.yml download>amss_environment.yml</a>
32-
file. This specifies the software required and an environment can be
33-
created using [conda](https://docs.conda.io/en/latest/):
34-
35-
Open a terminal:
36-
37-
```{code-block} bash
38-
conda env create --file amss_environment.yml
39-
conda activate amss
40-
```
41-
4227
In addition to what's in Anaconda, this lecture will need the following libraries:
4328

4429
```{code-cell} ipython

lectures/amss3.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,6 @@ kernelspec:
2424
:depth: 2
2525
```
2626

27-
**Software Requirement:**
28-
29-
This lecture requires the use of some older software versions to run. If
30-
you would like to execute this lecture please download the following
31-
<a href=_static/downloads/amss_environment.yml download>amss_environment.yml</a>
32-
file. This specifies the software required and an environment can be
33-
created using [conda](https://docs.conda.io/en/latest/):
34-
35-
Open a terminal:
36-
37-
```{code-block} bash
38-
conda env create --file amss_environment.yml
39-
conda activate amss
40-
```
41-
4227
In addition to what's in Anaconda, this lecture will need the following libraries:
4328

4429
```{code-cell} ipython

lectures/arellano.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ import numpy as np
7979
import quantecon as qe
8080
import random
8181
82-
from numba import jit, jitclass, int64, float64
83-
82+
from numba import jit, int64, float64
83+
from numba.experimental import jitclass
8484
%matplotlib inline
8585
```
8686

lectures/black_litterman.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ sample = excess_return.rvs(T)
197197
w = np.linalg.solve(δ * Σ_est, μ_est)
198198
199199
fig, ax = plt.subplots(figsize=(8, 5))
200-
ax.set_title('Mean-variance portfolio weights recommendation \
201-
and the market portfolio')
200+
ax.set_title('Mean-variance portfolio weights recommendation and the market portfolio')
202201
ax.plot(np.arange(N)+1, w, 'o', c='k', label='$w$ (mean-variance)')
203202
ax.plot(np.arange(N)+1, w_m, 'o', c='r', label='$w_m$ (market portfolio)')
204203
ax.vlines(np.arange(N)+1, 0, w, lw=1)
@@ -219,7 +218,7 @@ Black and Litterman's responded to this situation in the following way:
219218
- They want to continue to allow the customer to express his or her
220219
risk tolerance by setting $\delta$.
221220
- Leaving $\Sigma$ at its maximum-likelihood value, they push
222-
$\mu$ away from its maximum value in a way designed to make
221+
$\mu$ away from its maximum-likelihood value in a way designed to make
223222
portfolio choices that are more plausible in terms of conforming to
224223
what most people actually do.
225224

@@ -314,8 +313,7 @@ d_m = r_m / σ_m
314313
μ_m = (d_m * Σ_est @ w_m).reshape(N, 1)
315314
316315
fig, ax = plt.subplots(figsize=(8, 5))
317-
ax.set_title(r'Difference between $\hat{\mu}$ (estimate) and \
318-
$\mu_{BL}$ (market implied)')
316+
ax.set_title(r'Difference between $\hat{\mu}$ (estimate) and $\mu_{BL}$ (market implied)')
319317
ax.plot(np.arange(N)+1, μ_est, 'o', c='k', label='$\hat{\mu}$')
320318
ax.plot(np.arange(N)+1, μ_m, 'o', c='r', label='$\mu_{BL}$')
321319
ax.vlines(np.arange(N) + 1, μ_m, μ_est, lw=1)
@@ -418,8 +416,7 @@ def BL_plot(τ):
418416
ax[0].vlines(np.arange(N)+1, μ_m, μ_est, lw=1)
419417
ax[0].axhline(0, c='k', ls='--')
420418
ax[0].set(xlim=(0, N+1), xlabel='Assets',
421-
title=r'Relationship between $\hat{\mu}$, \
422-
$\mu_{BL}$and$\tilde{\mu}$')
419+
title=r'Relationship between $\hat{\mu}$, $\mu_{BL}$, and $ \tilde{\mu}$')
423420
ax[0].xaxis.set_ticks(np.arange(1, N+1, 1))
424421
ax[0].legend(numpoints=1)
425422

lectures/cattle_cycles.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,15 @@ econ2.irf(ts_length=25, shock=shock_demand)
357357
econ3.irf(ts_length=25, shock=shock_demand)
358358
359359
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4))
360-
ax1.plot(econ1.c_irf, label='$\\rho=0.6$')
361-
ax1.plot(econ2.c_irf, label='$\\rho=1$')
362-
ax1.plot(econ3.c_irf, label='$\\rho=0$')
360+
ax1.plot(econ1.c_irf, label=r'$\rho=0.6$')
361+
ax1.plot(econ2.c_irf, label=r'$\rho=1$')
362+
ax1.plot(econ3.c_irf, label=r'$\rho=0$')
363363
ax1.set_title('Consumption response to demand shock')
364364
ax1.legend()
365365
366-
ax2.plot(econ1.k_irf[:, 0], label='$\\rho=0.6$')
367-
ax2.plot(econ2.k_irf[:, 0], label='$\\rho=1$')
368-
ax2.plot(econ3.k_irf[:, 0], label='$\\rho=0$')
366+
ax2.plot(econ1.k_irf[:, 0], label=r'$\rho=0.6$')
367+
ax2.plot(econ2.k_irf[:, 0], label=r'$\rho=1$')
368+
ax2.plot(econ3.k_irf[:, 0], label=r'$\rho=0$')
369369
ax2.set_title('Breeding stock response to demand shock')
370370
ax2.legend()
371371
plt.show()
@@ -393,11 +393,11 @@ total3_irf = econ3.k_irf[:, 0] + g * econ3.k_irf[:, 1] + g * econ3.k_irf[:, 2]
393393
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4))
394394
ax1.plot(econ1.k_irf[:, 0], label='Breeding Stock')
395395
ax1.plot(total1_irf, label='Total Stock')
396-
ax1.set_title('$\\rho=0.6$')
396+
ax1.set_title(r'$\rho=0.6$')
397397
398398
ax2.plot(econ3.k_irf[:, 0], label='Breeding Stock')
399399
ax2.plot(total3_irf, label='Total Stock')
400-
ax2.set_title('$\\rho=0$')
400+
ax2.set_title(r'$\rho=0$')
401401
plt.show()
402402
```
403403

lectures/classical_filtering.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ $$
223223

224224
### Implementation
225225

226-
Here's the code that computes solutions to LQ control and filtering problems using the methods described here and in :doc: lu_tricks.
226+
Here's the code that computes solutions to LQ control and filtering problems using the methods described here and in {doc}`lu_tricks <lu_tricks>`.
227227

228228
```{literalinclude} _static/lecture_specific/lu_tricks/control_and_filter.py
229229
```
@@ -255,7 +255,7 @@ h = 0.0
255255
example = LQFilter(d, h, y_m, r=d)
256256
```
257257

258-
The Wold representation is computed by example.coefficients_of_c().
258+
The Wold representation is computed by `example.coeffs_of_c()`.
259259

260260
Let's check that it "flips roots" as required
261261

lectures/cons_news.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ y_{t+1} - y_t = a_{t+1} - \beta a_t \quad
123123
```
124124

125125
where $\{a_t\}$ is another i.i.d. normally distributed scalar
126-
process, with means of zero and now variances $\sigma_a^2$.
126+
process, with means of zero and now variances $\sigma_a^2 > \sigma_\epsilon^2$.
127127

128128
The two i.i.d. shock variances are related by
129129

@@ -175,7 +175,7 @@ Using calculations in the {doc}`quantecon lecture <classical_filtering>`, where
175175
$z \in C$ is a complex variable, the covariance generating
176176
function $g (z) =
177177
\sum_{j=-\infty}^\infty g_j z^j$
178-
of the $\{(y_t - y_{t-1})\}$ process equals
178+
of the $\{y_t - y_{t-1}\}$ process equals
179179

180180
$$
181181
g(z) = \sigma_\epsilon^2 h(z) h(z^{-1}) = \beta^{-2} \sigma_\epsilon^2 > \sigma_\epsilon^2 ,
@@ -420,9 +420,11 @@ exactly the same histories of nonfinancial income.
420420

421421
The consumer with information associated with representation {eq}`eqn_1`
422422
responds to each shock $\epsilon_{t+1}$ by leaving his consumption
423-
unaltered and **saving** all of $a_{t+1}$ in anticipation of the
424-
permanently increased taxes that he will bear to pay for the addition
425-
$a_{t+1}$ to his time $t+1$ nonfinancial income.
423+
unaltered and **saving** all of $\epsilon_{t+1}$ in anticipation of the
424+
permanently increased taxes that he will bear in order to service the permanent interest payments on the risk-free
425+
bonds that the government has
426+
presumably issued to pay for the one-time addition
427+
$\epsilon_{t+1}$ to his time $t+1$ nonfinancial income.
426428

427429
The consumer with information associated with representation {eq}`eqn_2`
428430
responds to a shock $a_{t+1}$ by increasing his consumption by

lectures/hs_recursive_models.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -717,17 +717,17 @@ $$
717717
$$
718718

719719
$$
720-
mu_t= - \beta^t [\Pi^\prime \Pi\, c_t - \Pi^\prime\, b_t]
720+
\mu_t= - \beta^t [\Pi^\prime \Pi\, c_t - \Pi^\prime\, b_t]
721721
$$
722722

723723
$$
724-
c_t = - (\Pi^\prime \Pi)^{-1} \beta^{-t} mu_t + (\Pi^\prime \Pi)^{-1}
724+
c_t = - (\Pi^\prime \Pi)^{-1} \beta^{-t} \mu_t + (\Pi^\prime \Pi)^{-1}
725725
\Pi^\prime b_t
726726
$$
727727

728728
This is called the **Frisch demand function** for consumption.
729729

730-
We can think of the vector $mu_t$ as playing the role of prices,
730+
We can think of the vector $\mu_t$ as playing the role of prices,
731731
up to a common factor, for all dates and states.
732732

733733
The scale factor is
@@ -784,7 +784,7 @@ $$
784784
b_t) \cdot ( s_t - b_t) + \ell_t^2 ] \bigl| J_0 , \ 0 < \beta < 1
785785
$$
786786

787-
*Next steps:** we move on to discuss two closely connected concepts
787+
**Next steps:** we move on to discuss two closely connected concepts
788788

789789
- A Planning Problem or Optimal Resource Allocation Problem
790790
- Competitive Equilibrium
@@ -1753,13 +1753,14 @@ Apply the following version of a factorization identity:
17531753

17541754
$$
17551755
\begin{aligned}
1756-
[\Pi &+ \beta^{1/2} L^{-1} \Lambda (I - \beta^{1/2} L^{-1}
1756+
&[\Pi + \beta^{1/2} L^{-1} \Lambda (I - \beta^{1/2} L^{-1}
17571757
\Delta_h)^{-1} \Theta_h]^\prime [\Pi + \beta^{1/2} L
1758-
\Lambda (I - \beta^{1/2} L \Delta_h)^{-1} \Theta_h]\\
1759-
&= [\hat\Pi + \beta^{1/2} L^{-1} \hat\Lambda
1758+
\Lambda (I - \beta^{1/2} L \Delta_h)^{-1} \Theta_h] \\
1759+
&\quad = [\hat\Pi + \beta^{1/2} L^{-1} \hat\Lambda
17601760
(I - \beta^{1/2} L^{-1} \Delta_h)^{-1} \Theta_h]^\prime
17611761
[\hat\Pi + \beta^{1/2} L \hat\Lambda
1762-
(I - \beta^{1/2} L \Delta_h)^{-1} \Theta_h]\end{aligned}
1762+
(I - \beta^{1/2} L \Delta_h)^{-1} \Theta_h]
1763+
\end{aligned}
17631764
$$
17641765

17651766
The factorization identity guarantees that the

0 commit comments

Comments
 (0)