Skip to content

Commit f621a93

Browse files
Copilotmmcky
andauthored
Standardize LaTeX math notation: replace pmatrix with bmatrix across all lecture files (#526)
* Initial plan * Standardize LaTeX math notation: replace pmatrix with bmatrix across all lecture files Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com> * Remove temporary conf.py file created during testing --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
1 parent 2ea0317 commit f621a93

File tree

7 files changed

+63
-63
lines changed

7 files changed

+63
-63
lines changed

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:

lectures/opt_transport.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ The **Kronecker product** of $A$ and $B$ is defined, in block matrix form, by
185185
186186
$$
187187
A \otimes B =
188-
\begin{pmatrix}
188+
\begin{bmatrix}
189189
a_{11}B & a_{12}B & \dots & a_{1s}B \\
190190
a_{21}B & a_{22}B & \dots & a_{2s}B \\
191191
& & \vdots & \\
192192
a_{m1}B & a_{m2}B & \dots & a_{ms}B \\
193-
\end{pmatrix}.
193+
\end{bmatrix}.
194194
$$
195195
196196
$A \otimes B$ is an $mn \times st$ matrix.
@@ -243,15 +243,15 @@ where
243243
244244
$$
245245
A =
246-
\begin{pmatrix}
246+
\begin{bmatrix}
247247
\mathbf{1}_n' \otimes \mathbf{I}_m \\
248248
\mathbf{I}_n \otimes \mathbf{1}_m' \\
249-
\end{pmatrix}
249+
\end{bmatrix}
250250
\quad \text{and} \quad
251-
b = \begin{pmatrix}
251+
b = \begin{bmatrix}
252252
p \\
253253
q \\
254-
\end{pmatrix}
254+
\end{bmatrix}
255255
$$
256256
257257
@@ -300,27 +300,27 @@ The numbers in the above table tell us to set $m = 3$, $n = 5$, and construct
300300
the following objects:
301301
302302
$$
303-
p = \begin{pmatrix}
303+
p = \begin{bmatrix}
304304
50 \\
305305
100 \\
306306
150
307-
\end{pmatrix},
307+
\end{bmatrix},
308308
\quad
309309
q =
310-
\begin{pmatrix}
310+
\begin{bmatrix}
311311
25 \\
312312
115 \\
313313
60 \\
314314
30 \\
315315
70
316-
\end{pmatrix}
316+
\end{bmatrix}
317317
\quad \text{and} \quad
318318
C =
319-
\begin{pmatrix}
319+
\begin{bmatrix}
320320
10 &15 &20 &20 &40 \\
321321
20 &40 &15 &30 &30 \\
322322
30 &35 &40 &55 &25
323-
\end{pmatrix}.
323+
\end{bmatrix}.
324324
$$
325325
326326
Let's write Python code that sets up the problem and solves it.
@@ -576,7 +576,7 @@ We can write the dual problem as
576576
$$
577577
\begin{aligned}
578578
\max_{u_i, v_j} \ & p u + q v \\
579-
\mbox{subject to } \ & A' \begin{pmatrix} u \\ v \\ \end{pmatrix} = \operatorname{vec}(C) \\
579+
\mbox{subject to } \ & A' \begin{bmatrix} u \\ v \\ \end{bmatrix} = \operatorname{vec}(C) \\
580580
\end{aligned}
581581
$$ (dualproblem2)
582582

lectures/stats_examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Its distribution is
105105
$$
106106
\begin{aligned}
107107
X & \sim NB(r,p) \\
108-
\textrm{Prob}(X=k;r,p) & = \begin{pmatrix}k+r-1 \\ r-1 \end{pmatrix}p^r(1-p)^{k}
108+
\textrm{Prob}(X=k;r,p) & = \begin{bmatrix}k+r-1 \\ r-1 \end{bmatrix}p^r(1-p)^{k}
109109
\end{aligned}
110110
$$
111111

lectures/svd_intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ of rank $1$.
654654
Thus, we have
655655
656656
$$
657-
X = \sigma_1 \begin{pmatrix}U_{11}V_{1}^\top \\U_{21}V_{1}^\top \\\cdots\\U_{m1}V_{1}^\top \\\end{pmatrix} + \sigma_2\begin{pmatrix}U_{12}V_{2}^\top \\U_{22}V_{2}^\top \\\cdots\\U_{m2}V_{2}^\top \\\end{pmatrix}+\ldots + \sigma_p\begin{pmatrix}U_{1p}V_{p}^\top \\U_{2p}V_{p}^\top \\\cdots\\U_{mp}V_{p}^\top \\\end{pmatrix}
657+
X = \sigma_1 \begin{bmatrix}U_{11}V_{1}^\top \\U_{21}V_{1}^\top \\\cdots\\U_{m1}V_{1}^\top \\\end{bmatrix} + \sigma_2\begin{bmatrix}U_{12}V_{2}^\top \\U_{22}V_{2}^\top \\\cdots\\U_{m2}V_{2}^\top \\\end{bmatrix}+\ldots + \sigma_p\begin{bmatrix}U_{1p}V_{p}^\top \\U_{2p}V_{p}^\top \\\cdots\\U_{mp}V_{p}^\top \\\end{bmatrix}
658658
$$ (eq:PCA2)
659659
660660
Here is how we would interpret the objects in the matrix equation {eq}`eq:PCA2` in

0 commit comments

Comments
 (0)