Skip to content

Commit 54fec25

Browse files
Copilotmmcky
andcommitted
Standardize LaTeX math notation: replace pmatrix with bmatrix across all lecture files
Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
1 parent 4f03f09 commit 54fec25

8 files changed

Lines changed: 114 additions & 63 deletions

File tree

lectures/conf.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
###############################################################################
2+
# Auto-generated by `jupyter-book config`
3+
# If you wish to continue using _config.yml, make edits to that file and
4+
# re-generate this one.
5+
###############################################################################
6+
author = 'Thomas J. Sargent & John Stachurski'
7+
bibtex_bibfiles = ['_static/quant-econ.bib']
8+
bibtex_reference_style = 'author_year'
9+
comments_config = {'hypothesis': False, 'utterances': False}
10+
copyright = '2023'
11+
exclude_patterns = ['**.ipynb_checkpoints', '.DS_Store', 'Thumbs.db', '_build']
12+
extensions = ['sphinx_togglebutton', 'sphinx_copybutton', 'myst_nb', 'jupyter_book', 'sphinx_thebe', 'sphinx_comments', 'sphinx_external_toc', 'sphinx.ext.intersphinx', 'sphinx_design', 'sphinx_book_theme', 'sphinx_multitoc_numbering', 'sphinxext.rediraffe', 'sphinx_tojupyter', 'sphinxcontrib.youtube', 'sphinx.ext.todo', 'sphinx_exercise', 'sphinx_proof', 'sphinx_reredirects', 'sphinxcontrib.bibtex', 'sphinx_jupyterbook_latex', 'sphinx_multitoc_numbering']
13+
external_toc_exclude_missing = True
14+
external_toc_path = '_toc.yml'
15+
html_baseurl = 'https://python.quantecon.org/'
16+
html_favicon = '_static/lectures-favicon.ico'
17+
html_logo = '_static/qe-logo-large.png'
18+
html_sourcelink_suffix = ''
19+
html_static_path = ['_static', '_static']
20+
html_theme = 'quantecon_book_theme'
21+
html_theme_options = {'authors': [{'name': 'Thomas J. Sargent', 'url': 'http://www.tomsargent.com/'}, {'name': 'John Stachurski', 'url': 'https://johnstachurski.net/'}], 'header_organisation_url': 'https://quantecon.org', 'header_organisation': 'QuantEcon', 'repository_url': 'https://github.com/QuantEcon/lecture-python.myst', 'nb_repository_url': 'https://github.com/QuantEcon/lecture-python.notebooks', 'twitter': 'quantecon', 'twitter_logo_url': 'https://assets.quantecon.org/img/qe-twitter-logo.png', 'og_logo_url': 'https://assets.quantecon.org/img/qe-og-logo.png', 'description': 'This website presents a set of lectures on quantitative economic modeling, designed and written by Thomas J. Sargent and John Stachurski.', 'keywords': 'Python, QuantEcon, Quantitative Economics, Economics, Sloan, Alfred P. Sloan Foundation, Tom J. Sargent, John Stachurski', 'analytics': {'google_analytics_id': 'G-J0SMYR4SG3'}, 'launch_buttons': {'colab_url': 'https://colab.research.google.com'}}
22+
html_title = 'Intermediate Quantitative Economics with Python'
23+
intersphinx_mapping = {'intro': ['https://intro.quantecon.org/', None], 'advanced': ['https://python-advanced.quantecon.org', None]}
24+
latex_engine = 'pdflatex'
25+
linkcheck_ignore = ['https://online.stat.psu.edu/stat415/book/export/html/834']
26+
mathjax3_config = {'tex': {'macros': {'argmax': 'arg\\,max', 'argmin': 'arg\\,min'}}}
27+
mathjax_path = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js'
28+
myst_enable_extensions = ['amsmath', 'colon_fence', 'deflist', 'dollarmath', 'html_admonition', 'html_image', 'linkify', 'replacements', 'smartquotes', 'substitution']
29+
myst_url_schemes = ['mailto', 'http', 'https']
30+
nb_execution_allow_errors = False
31+
nb_execution_cache_path = ''
32+
nb_execution_excludepatterns = []
33+
nb_execution_in_temp = False
34+
nb_execution_mode = 'cache'
35+
nb_execution_timeout = 2400
36+
nb_mime_priority_overrides = [['html', 'application/vnd.jupyter.widget-view+json', 10], ['html', 'application/javascript', 20], ['html', 'text/html', 30], ['html', 'text/latex', 40], ['html', 'image/svg+xml', 50], ['html', 'image/png', 60], ['html', 'image/jpeg', 70], ['html', 'text/markdown', 80], ['html', 'text/plain', 90], ['jupyter', 'application/vnd.jupyter.widget-view+json', 10], ['jupyter', 'application/javascript', 20], ['jupyter', 'text/html', 30], ['jupyter', 'text/latex', 40], ['jupyter', 'image/svg+xml', 50], ['jupyter', 'image/png', 60], ['jupyter', 'image/jpeg', 70], ['jupyter', 'text/markdown', 80], ['jupyter', 'text/plain', 90], ['latex', 'text/latex', 10], ['latex', 'application/pdf', 20], ['latex', 'image/png', 30], ['latex', 'image/jpeg', 40], ['latex', 'text/markdown', 50], ['latex', 'text/plain', 60], ['linkcheck', 'text/plain', 10]]
37+
nb_output_stderr = 'show'
38+
numfig = True
39+
pygments_style = 'sphinx'
40+
rediraffe_redirects = {'index_toc.md': 'intro.md'}
41+
redirects = {'heavy_tails': 'https://intro.quantecon.org/heavy_tails.html', 'ar1_processes': 'https://intro.quantecon.org/ar1_processes.html', 'geom_series': 'https://intro.quantecon.org/geom_series.html', 'lp_intro': 'https://intro.quantecon.org/lp_intro.html', 'short_path': 'https://intro.quantecon.org/short_path.html', 'schelling': 'https://intro.quantecon.org/schelling.html', 'scalar_dynam': 'https://intro.quantecon.org/scalar_dynam.html', 'complex_and_trig': 'https://intro.quantecon.org/complex_and_trig.html'}
42+
suppress_warnings = ['myst.domains']
43+
tojupyter_image_urlpath = 'https://python.quantecon.org/_static/'
44+
tojupyter_images_markdown = True
45+
tojupyter_kernels = {'python3': {'kernelspec': {'display_name': 'Python', 'language': 'python3', 'name': 'python3'}, 'file_extension': '.py'}}
46+
tojupyter_lang_synonyms = ['ipython', 'ipython3', 'python']
47+
tojupyter_static_file_path = ['source/_static', '_static']
48+
tojupyter_target_html = True
49+
tojupyter_urlpath = 'https://python.quantecon.org/'
50+
use_jupyterbook_latex = True
51+
use_multitoc_numbering = True

lectures/lagrangian_lqdp.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -206,29 +206,29 @@ It is useful to proceed with the following steps:
206206
* arrange the resulting equation and the second equation of {eq}`lag-lqdp-eq2` into the form
207207
208208
$$
209-
L\ \begin{pmatrix}x_{t+1}\cr \mu_{t+1}\cr\end{pmatrix}\ = \ N\ \begin{pmatrix}x_t\cr \mu_t\cr\end{pmatrix}\
209+
L\ \begin{bmatrix}x_{t+1}\cr \mu_{t+1}\cr\end{bmatrix}\ = \ N\ \begin{bmatrix}x_t\cr \mu_t\cr\end{bmatrix}\
210210
,\ t \geq 0,
211211
$$ (eq:systosolve)
212212
213213
where
214214
215215
$$
216-
L = \ \begin{pmatrix}I & BQ^{-1} B^\prime \cr 0 & A^\prime\cr\end{pmatrix}, \quad N = \
217-
\begin{pmatrix}A & 0\cr -R & I\cr\end{pmatrix}.
216+
L = \ \begin{bmatrix}I & BQ^{-1} B^\prime \cr 0 & A^\prime\cr\end{bmatrix}, \quad N = \
217+
\begin{bmatrix}A & 0\cr -R & I\cr\end{bmatrix}.
218218
$$
219219
220220
When $L$ is of full rank (i.e., when $A$ is of full rank), we can write
221221
system {eq}`eq:systosolve` as
222222
223223
$$
224-
\begin{pmatrix}x_{t+1}\cr \mu_{t+1}\cr\end{pmatrix}\ = M\ \begin{pmatrix}x_t\cr\mu_t\cr\end{pmatrix}
224+
\begin{bmatrix}x_{t+1}\cr \mu_{t+1}\cr\end{bmatrix}\ = M\ \begin{bmatrix}x_t\cr\mu_t\cr\end{bmatrix}
225225
$$ (eq4orig)
226226
227227
where
228228
229229
$$
230-
M\equiv L^{-1} N = \begin{pmatrix}A+B Q^{-1} B^\prime A^{\prime-1}R &
231-
-B Q^{-1} B^\prime A^{\prime-1}\cr -A^{\prime -1} R & A^{\prime -1}\cr\end{pmatrix}.
230+
M\equiv L^{-1} N = \begin{bmatrix}A+B Q^{-1} B^\prime A^{\prime-1}R &
231+
-B Q^{-1} B^\prime A^{\prime-1}\cr -A^{\prime -1} R & A^{\prime -1}\cr\end{bmatrix}.
232232
$$ (Mdefn)
233233
234234
+++
@@ -262,7 +262,7 @@ To proceed, we study properties of the $(2n \times 2n)$ matrix $M$ defined in {e
262262
It helps to introduce a $(2n \times 2n)$ matrix
263263
264264
$$
265-
J = \begin{pmatrix}0 & -I_n\cr I_n & 0\cr\end{pmatrix}.
265+
J = \begin{bmatrix}0 & -I_n\cr I_n & 0\cr\end{bmatrix}.
266266
$$
267267
268268
The rank of $J$ is $2n$.
@@ -308,12 +308,12 @@ $$
308308
y_{t+1} = M y_t
309309
$$ (eq658)
310310
311-
where $y_t = \begin{pmatrix}x_t\cr \mu_t\cr\end{pmatrix}$.
311+
where $y_t = \begin{bmatrix}x_t\cr \mu_t\cr\end{bmatrix}$.
312312
313313
Consider a **triangularization** of $M$
314314
315315
$$
316-
V^{-1} M V= \begin{pmatrix}W_{11} & W_{12} \cr 0 & W_{22}\cr\end{pmatrix}
316+
V^{-1} M V= \begin{bmatrix}W_{11} & W_{12} \cr 0 & W_{22}\cr\end{bmatrix}
317317
$$ (eqn:triangledecomp)
318318
319319
where
@@ -353,9 +353,9 @@ and where $W^t_{ii}$ is $W_{ii}$ raised to the $t$th power.
353353
Write equation {eq}`eq6510` as
354354
355355
$$
356-
\begin{pmatrix}y^\ast_{1t}\cr y^\ast_{2t}\cr\end{pmatrix}\ =\ \left[\begin{matrix} W^t_{11} &
357-
W_{12, t}\cr 0 & W^t_{22}\cr\end{matrix}\right]\quad \begin{pmatrix}y^\ast_{10}\cr
358-
y^\ast_{20}\cr\end{pmatrix}
356+
\begin{bmatrix}y^\ast_{1t}\cr y^\ast_{2t}\cr\end{bmatrix}\ =\ \left[\begin{matrix} W^t_{11} &
357+
W_{12, t}\cr 0 & W^t_{22}\cr\end{matrix}\right]\quad \begin{bmatrix}y^\ast_{10}\cr
358+
y^\ast_{20}\cr\end{bmatrix}
359359
$$
360360
361361
where $y^\ast_t = V^{-1} y_t$, and in particular where
@@ -394,7 +394,7 @@ But notice that because $(V^{21}\ V^{22})$ is the second row block of
394394
the inverse of $V,$ it follows that
395395
396396
$$
397-
(V^{21} \ V^{22})\quad \begin{pmatrix}V_{11}\cr V_{21}\cr\end{pmatrix} = 0
397+
(V^{21} \ V^{22})\quad \begin{bmatrix}V_{11}\cr V_{21}\cr\end{bmatrix} = 0
398398
$$
399399
400400
which implies

lectures/lake_model.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ $$
155155
X_{t+1} = A X_t
156156
\quad \text{where} \quad
157157
A :=
158-
\begin{pmatrix}
158+
\begin{bmatrix}
159159
(1-d)(1-\lambda) + b & (1-d)\alpha + b \\
160160
(1-d)\lambda & (1-d)(1-\alpha)
161-
\end{pmatrix}
161+
\end{bmatrix}
162162
$$
163163

164164
This law tells us how total employment and unemployment evolve over time.
@@ -170,16 +170,16 @@ Now let's derive the law of motion for rates.
170170
To get these we can divide both sides of $X_{t+1} = A X_t$ by $N_{t+1}$ to get
171171

172172
$$
173-
\begin{pmatrix}
173+
\begin{bmatrix}
174174
U_{t+1}/N_{t+1} \\
175175
E_{t+1}/N_{t+1}
176-
\end{pmatrix} =
176+
\end{bmatrix} =
177177
\frac1{1+g} A
178-
\begin{pmatrix}
178+
\begin{bmatrix}
179179
U_{t}/N_{t}
180180
\\
181181
E_{t}/N_{t}
182-
\end{pmatrix}
182+
\end{bmatrix}
183183
$$
184184

185185
Letting

lectures/multi_hyper.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Things have to add up so $\sum_{i=1}^c k_i = n$.
7171
Under the hypothesis that the selection process judges proposals on their quality and that quality is independent of continent of the author's continent of residence, the administrator views the outcome of the selection procedure as a random vector
7272

7373
$$
74-
X = \begin{pmatrix} k_1 \cr k_2 \cr \vdots \cr k_c \end{pmatrix}.
74+
X = \begin{bmatrix} k_1 \cr k_2 \cr \vdots \cr k_c \end{bmatrix}.
7575
$$
7676

7777
To evaluate whether the selection procedure is **color blind** the administrator wants to study whether the particular realization of $X$ drawn can plausibly
@@ -94,7 +94,7 @@ So $n = 15$.
9494
The administrator wants to know the probability distribution of outcomes
9595

9696
$$
97-
X = \begin{pmatrix} k_1 \cr k_2 \cr \vdots \cr k_4 \end{pmatrix}.
97+
X = \begin{bmatrix} k_1 \cr k_2 \cr \vdots \cr k_4 \end{bmatrix}.
9898
$$
9999

100100
In particular, he wants to know whether a particular
@@ -272,7 +272,7 @@ K_arr = [5, 10, 15]
272272
urn = Urn(K_arr)
273273
```
274274

275-
Now use the Urn Class method `pmf` to compute the probability of the outcome $X = \begin{pmatrix} 2 & 2 & 2 \end{pmatrix}$
275+
Now use the Urn Class method `pmf` to compute the probability of the outcome $X = \begin{bmatrix} 2 & 2 & 2 \end{bmatrix}$
276276

277277
```{code-cell} python3
278278
k_arr = [2, 2, 2] # array of number of observed successes

lectures/newton_method.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -513,20 +513,20 @@ An equilibrium price vector $p^*$ satisfies $e_i(p^*) = 0$.
513513
We set
514514

515515
$$
516-
A = \begin{pmatrix}
516+
A = \begin{bmatrix}
517517
a_{00} & a_{01} \\
518518
a_{10} & a_{11}
519-
\end{pmatrix},
519+
\end{bmatrix},
520520
\qquad
521-
b = \begin{pmatrix}
521+
b = \begin{bmatrix}
522522
b_0 \\
523523
b_1
524-
\end{pmatrix}
524+
\end{bmatrix}
525525
\qquad \text{and} \qquad
526-
c = \begin{pmatrix}
526+
c = \begin{bmatrix}
527527
c_0 \\
528528
c_1
529-
\end{pmatrix}
529+
\end{bmatrix}
530530
$$
531531

532532
for this particular question.
@@ -539,10 +539,10 @@ Our first step is to define the excess demand function
539539

540540
$$
541541
e(p) =
542-
\begin{pmatrix}
542+
\begin{bmatrix}
543543
e_0(p) \\
544544
e_1(p)
545-
\end{pmatrix}
545+
\end{bmatrix}
546546
$$
547547

548548
The function below calculates the excess demand for given parameters
@@ -556,20 +556,20 @@ Our default parameter values will be
556556

557557

558558
$$
559-
A = \begin{pmatrix}
559+
A = \begin{bmatrix}
560560
0.5 & 0.4 \\
561561
0.8 & 0.2
562-
\end{pmatrix},
562+
\end{bmatrix},
563563
\qquad
564-
b = \begin{pmatrix}
564+
b = \begin{bmatrix}
565565
1 \\
566566
1
567-
\end{pmatrix}
567+
\end{bmatrix}
568568
\qquad \text{and} \qquad
569-
c = \begin{pmatrix}
569+
c = \begin{bmatrix}
570570
1 \\
571571
1
572-
\end{pmatrix}
572+
\end{bmatrix}
573573
$$
574574

575575
```{code-cell} ipython3
@@ -689,10 +689,10 @@ Here we manually calculate the elements of the Jacobian
689689

690690
$$
691691
J(p) =
692-
\begin{pmatrix}
692+
\begin{bmatrix}
693693
\frac{\partial e_0}{\partial p_0}(p) & \frac{\partial e_0}{\partial p_1}(p) \\
694694
\frac{\partial e_1}{\partial p_0}(p) & \frac{\partial e_1}{\partial p_1}(p)
695-
\end{pmatrix}
695+
\end{bmatrix}
696696
$$
697697

698698
```{code-cell} ipython3
@@ -850,11 +850,11 @@ np.max(np.abs(e(p, A, b, c)))
850850
Consider a three-dimensional extension of the Solow fixed point problem with
851851

852852
$$
853-
A = \begin{pmatrix}
853+
A = \begin{bmatrix}
854854
2 & 3 & 3 \\
855855
2 & 4 & 2 \\
856856
1 & 5 & 1 \\
857-
\end{pmatrix},
857+
\end{bmatrix},
858858
\quad
859859
s = 0.2, \quad α = 0.5, \quad δ = 0.8
860860
$$
@@ -886,11 +886,11 @@ $$
886886
- If you are unsure about your solution, you can start with the solved example:
887887
888888
```{math}
889-
A = \begin{pmatrix}
889+
A = \begin{bmatrix}
890890
2 & 0 & 0 \\
891891
0 & 2 & 0 \\
892892
0 & 0 & 2 \\
893-
\end{pmatrix}
893+
\end{bmatrix}
894894
```
895895
896896
with $s = 0.3$, $α = 0.3$, and $δ = 0.4$ and starting value:
@@ -999,23 +999,23 @@ In this exercise, let's try different initial values and check how Newton's meth
999999
Let's define a three-good problem with the following default values:
10001000

10011001
$$
1002-
A = \begin{pmatrix}
1002+
A = \begin{bmatrix}
10031003
0.2 & 0.1 & 0.7 \\
10041004
0.3 & 0.2 & 0.5 \\
10051005
0.1 & 0.8 & 0.1 \\
1006-
\end{pmatrix},
1006+
\end{bmatrix},
10071007
\qquad
1008-
b = \begin{pmatrix}
1008+
b = \begin{bmatrix}
10091009
1 \\
10101010
1 \\
10111011
1
1012-
\end{pmatrix}
1012+
\end{bmatrix}
10131013
\qquad \text{and} \qquad
1014-
c = \begin{pmatrix}
1014+
c = \begin{bmatrix}
10151015
1 \\
10161016
1 \\
10171017
1
1018-
\end{pmatrix}
1018+
\end{bmatrix}
10191019
$$
10201020

10211021
For this exercise, use the following extreme price vectors as initial values:

0 commit comments

Comments
 (0)