Skip to content

Commit e12e3e2

Browse files
mmckyHumphreyYang
andauthored
ENH: Add link checker to GitHub Actions Workflow (#120)
* ENH: Add link checker to GitHub Actions Workflow * Reference and link fix * fix all broken links * update missing links * update stationary density * update infinite horizon Co-authored-by: Humphrey Yang <u6474961@anu.edu.au>
1 parent 87bff6e commit e12e3e2

10 files changed

+68
-25
lines changed

.github/workflows/linkcheck.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Link Checker [Anaconda, Linux]
2+
on:
3+
pull_request:
4+
types: [opened, reopened]
5+
schedule:
6+
# UTC 12:00 is early morning in Australia
7+
- cron: '0 12 * * *'
8+
jobs:
9+
link-check-linux:
10+
name: Link Checking (${{ matrix.python-version }}, ${{ matrix.os }})
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: ["ubuntu-latest"]
16+
python-version: ["3.9"]
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
- name: Setup Anaconda
21+
uses: conda-incubator/setup-miniconda@v2
22+
with:
23+
auto-update-conda: true
24+
auto-activate-base: true
25+
miniconda-version: 'latest'
26+
python-version: 3.9
27+
environment-file: environment.yml
28+
activate-environment: quantecon
29+
- name: Download "build" folder (cache)
30+
uses: dawidd6/action-download-artifact@v2
31+
with:
32+
workflow: cache.yml
33+
branch: main
34+
name: build-cache
35+
path: _build
36+
- name: Link Checker
37+
shell: bash -l {0}
38+
run: jb build lectures --path-output=./ --builder=custom --custom-builder=linkcheck
39+
- name: Upload Link Checker Reports
40+
uses: actions/upload-artifact@v2
41+
if: failure()
42+
with:
43+
name: linkcheck-reports
44+
path: _build/linkcheck

lectures/BCG_complete_mkts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ This simplification of BCG’s setup helps us by
5858
- introducing `Big K, little k` issues in a simple context that will
5959
recur in the BCG incomplete markets environment
6060

61-
A Big K, little k analysis also played roles in [this quantecon lecture](https://python.quantecon.org/cass_koopmans.html) as well as
61+
A Big K, little k analysis also played roles in [this quantecon lecture](https://python.quantecon.org/cass_koopmans_1.html) as well as
6262
[here](https://python.quantecon.org/rational_expectations.html) and {doc}`here <dyn_stack>`.
6363

6464
### Setup

lectures/_static/quant-econ.bib

+3-4
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ @Article{Ross_78
170170
pages={453-475},
171171
month={July},
172172
keywords={},
173-
doi={10.1086/296008},
174173
abstract={No abstract is available for this item.},
175174
url={https://ideas.repec.org/a/ucp/jnlbus/v51y1978i3p453-75.html}
176175
}
@@ -297,7 +296,7 @@ @Article{townsend
297296
year =1983
298297
}
299298

300-
@Article{sargent91,
299+
@Article{sargent91_equilibrium,
301300
author ={Thomas J. Sargent},
302301
title ={Equilibrium with Signal Extraction from Endogenous Variables},
303302
journal ={Journal of Economic Dynamics and Control},
@@ -306,7 +305,7 @@ @Article{sargent91
306305
year =1991
307306
}
308307

309-
@Inproceedings{singleton,
308+
@Inproceedings{singleton87,
310309
author ={Kenneth J. Singleton},
311310
title ={Asset Prices in a Time-Series Model with Disparately Informed
312311
Competitive Traders},
@@ -2378,7 +2377,7 @@ @Article{Hansen_2012_Eca
23782377
pages={911-967},
23792378
month={May},
23802379
keywords={},
2381-
doi={ECTA8070},
2380+
doi={10.3982/ECTA8070},
23822381
abstract={No abstract is available for this item.},
23832382
url={https://ideas.repec.org/a/ecm/emetrp/v80y2012i3p911-967.html}
23842383
}

lectures/additive_functionals.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ with an initial condition for $y_0$.
230230

231231
While {eq}`ftaf` is not a first order system like {eq}`old1_additive_functionals`, we know that it can be mapped into a first order system.
232232

233-
* For an example of such a mapping, see [this example](https://python-intro.quantecon.org/linear_models.html#Second-order-Difference-Equation).
233+
* For an example of such a mapping, see [this example](https://python.quantecon.org/linear_models.html#second-order-difference-equation).
234234

235235
In fact, this whole model can be mapped into the additive functional system definition in {eq}`old1_additive_functionals` -- {eq}`old2_additive_functionals` by appropriate selection of the matrices $A, B, D, F$.
236236

lectures/discrete_dp.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ For each $\sigma \in \Sigma$, define
195195
* $r_{\sigma}$ by $r_{\sigma}(s) := r(s, \sigma(s))$)
196196
* $Q_{\sigma}$ by $Q_{\sigma}(s, s') := Q(s, \sigma(s), s')$
197197

198-
Notice that $Q_\sigma$ is a [stochastic matrix](https://python-intro.quantecon.org/finite_markov.html#Stochastic-Matrices) on $S$.
198+
Notice that $Q_\sigma$ is a [stochastic matrix](https://python.quantecon.org/finite_markov.html#stochastic-matrices) on $S$.
199199

200200
It gives transition probabilities of the *controlled chain* when we follow policy $\sigma$.
201201

@@ -211,7 +211,7 @@ If we think of $r_\sigma$ as a column vector, then so is $Q_\sigma^t r_\sigma$,
211211
Comments
212212

213213
* $\{s_t\} \sim Q_\sigma$ means that the state is generated by stochastic matrix $Q_\sigma$.
214-
* See [this discussion](https://python-intro.quantecon.org/finite_markov.html#Multiple-Step-Transition-Probabilities) on computing expectations of Markov chains for an explanation of the expression in {eq}`ddp_expec`.
214+
* See [this discussion](https://python.quantecon.org/finite_markov.html#multiple-step-transition-probabilities) on computing expectations of Markov chains for an explanation of the expression in {eq}`ddp_expec`.
215215

216216
Notice that we're not really distinguishing between functions from $S$ to $\mathbb R$ and vectors in $\mathbb R^n$.
217217

@@ -913,7 +913,7 @@ plt.show()
913913
#### Dynamics of the Capital Stock
914914

915915
Finally, let us work on [Exercise
916-
2](https://python-intro.quantecon.org/optgrowth.html#Exercise-1), where we plot
916+
2](https://python.quantecon.org/optgrowth.html#exercises), where we plot
917917
the trajectories of the capital stock for three different discount
918918
factors, $0.9$, $0.94$, and $0.98$, with initial
919919
condition $k_0 = 0.1$.

lectures/knowing_forecasts_of_others.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1573,8 +1573,8 @@ it enlists the Kalman filter and invariant subspace methods for
15731573
solving systems of Euler
15741574
equations <sup><a href=#footnote1 id=footnote1-link>[5]</a></sup> .
15751575

1576-
As [[Sin87](https://python-advanced.quantecon.org/zreferences.html#id27)],
1577-
[[Kas00](https://python-advanced.quantecon.org/zreferences.html#id24)], and [[Sar91](https://python-advanced.quantecon.org/zreferences.html#id26)] also
1576+
As {cite}`singleton87`,
1577+
[[Kas00](https://python-advanced.quantecon.org/zreferences.html#id24)], and {cite}`sargent91_equilibrium` also
15781578
found, the equilibrium is fully revealing: observed prices tell
15791579
participants in industry $ i $ all of the information held by
15801580
participants in market $ -i $ ($ -i $ means not $ i $).
@@ -1595,7 +1595,7 @@ those forecasts are the same as their own, they know them.
15951595

15961596
### Further historical remarks
15971597

1598-
Sargent [[Sar91](https://python-advanced.quantecon.org/zreferences.html#id26)] proposed a way to compute an equilibrium
1598+
Sargent {cite}`sargent91_equilibrium` proposed a way to compute an equilibrium
15991599
without making Townsend’s approximation.
16001600

16011601
Extending the reasoning of [[Mut60](https://python-advanced.quantecon.org/zreferences.html#id110)], Sargent noticed that it is possible to

lectures/lucas_model.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ What is the correct price to pay for such a claim?
4444

4545
The elegant asset pricing model of Lucas {cite}`Lucas1978` attempts to answer this question in an equilibrium setting with risk-averse agents.
4646

47-
While we mentioned some consequences of Lucas' model [earlier](https://python-intro.quantecon.org/markov_asset.html#Risk-Neutral-Pricing), it is now time to work through the model more carefully and try to understand where the fundamental asset pricing equation comes from.
47+
While we mentioned some consequences of Lucas' model [earlier](https://python.quantecon.org/markov_asset.html#risk-neutral-pricing), it is now time to work through the model more carefully and try to understand where the fundamental asset pricing equation comes from.
4848

4949
A side benefit of studying Lucas' model is that it provides a beautiful illustration of model building in general and equilibrium pricing in competitive models in particular.
5050

lectures/permanent_income_dles.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ permanent income model.
272272
The state vector in the LQ problem is
273273
$\begin{bmatrix} z_t \\ b_t \end{bmatrix}$.
274274

275-
Consequently, the relevant elements of econ1.Sc are the same as in
275+
Consequently, the relevant elements of `econ1.Sc` are the same as in
276276
$-F$ occur when we apply other approaches to the same model in the lecture
277277
[Optimal Savings II: LQ Techniques](https://python-intro.quantecon.org/perm_income_cons.html) and [this Jupyter
278278
notebook](http://nbviewer.jupyter.org/github/QuantEcon/QuantEcon.notebooks/blob/master/permanent_income.ipynb).

lectures/robustness.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ This will involve crafting a *skinnier* set at the cost of a lower *level* (at
150150

151151
### Inspiring Video
152152

153-
If you want to understand more about why one serious quantitative researcher is interested in this approach, we recommend [Lars Peter Hansen's Nobel lecture](http://www.nobelprize.org/mediaplayer/index.php?id=1994).
153+
If you want to understand more about why one serious quantitative researcher is interested in this approach, we recommend [Lars Peter Hansen's Nobel lecture](https://www.nobelprize.org/prizes/economic-sciences/2013/hansen/lecture/).
154154

155155
### Other References
156156

@@ -165,7 +165,7 @@ For simplicity, we present ideas in the context of a class of problems with line
165165

166166
To fit in with [our earlier lecture on LQ control](https://python-intro.quantecon.org/lqcontrol.html), we will treat loss minimization rather than value maximization.
167167

168-
To begin, recall the [infinite horizon LQ problem](https://python-intro.quantecon.org/lqcontrol.html#Infinite-Horizon), where an agent chooses a sequence of controls $\{u_t\}$ to minimize
168+
To begin, recall the [infinite horizon LQ problem](https://python.quantecon.org/lqcontrol.html#infinite-horizon), where an agent chooses a sequence of controls $\{u_t\}$ to minimize
169169

170170
```{math}
171171
:label: rob_sih
@@ -312,7 +312,7 @@ $$
312312
$$
313313

314314
The operator $\mathcal B$ is the standard (i.e., non-robust) LQ Bellman operator, and $P = \mathcal B(P)$ is the standard matrix Riccati equation coming from the
315-
Bellman equation --- see [this discussion](https://python-intro.quantecon.org/lqcontrol.html#Infinite-Horizon).
315+
Bellman equation --- see [this discussion](https://python.quantecon.org/lqcontrol.html#infinite-horizon).
316316

317317
Under some regularity conditions (see {cite}`HansenSargent2008`), the operator $\mathcal B \circ \mathcal D$
318318
has a unique positive definite fixed point, which we denote below by $\hat P$.
@@ -445,7 +445,7 @@ subject to {eq}`rob_lomf`.
445445

446446
What's striking about this optimization problem is that it is once again an LQ discounted dynamic programming problem, with $\mathbf w = \{ w_t \}$ as the sequence of controls.
447447

448-
The expression for the optimal policy can be found by applying the usual LQ formula ([see here](https://python-intro.quantecon.org/lqcontrol.html#Infinite-Horizon)).
448+
The expression for the optimal policy can be found by applying the usual LQ formula ([see here](https://python.quantecon.org/lqcontrol.html#infinite-horizon)).
449449

450450
We denote it by $K(F, \theta)$, with the interpretation $w_{t+1} = K(F, \theta) x_t$.
451451

@@ -610,7 +610,7 @@ subject to
610610
x_{t+1} = (A + C K) x_t + B u_t
611611
```
612612

613-
Once again, the expression for the optimal policy can be found [here](https://python-intro.quantecon.org/lqcontrol.html#Infinite-Horizon) --- we denote
613+
Once again, the expression for the optimal policy can be found [here](https://python.quantecon.org/lqcontrol.html#infinite-horizon) --- we denote
614614
it by $\tilde F$.
615615

616616
(rb_eq)=
@@ -1147,7 +1147,7 @@ K(\hat F, \theta) = (\theta I - C'\hat P C)^{-1} C' \hat P (A - B \hat F)
11471147
\beta (A - B \hat F)' \tilde P (A - B \hat F)
11481148
```
11491149

1150-
(revisit [this discussion](https://python-intro.quantecon.org/lqcontrol.html#Infinite-Horizon) if you don't know where {eq}`rb_a2be` comes from) and the optimal policy is
1150+
(revisit [this discussion](https://python.quantecon.org/lqcontrol.html#infinite-horizon) if you don't know where {eq}`rb_a2be` comes from) and the optimal policy is
11511151

11521152
$$
11531153
w_{t+1} = - \beta (\beta \theta I + \beta C' \tilde P C)^{-1}

lectures/stationary_densities.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ $\sigma(x) = s f(x)$ is strictly positive for all $s$ as required)
283283

284284
### Distribution Dynamics
285285

286-
In [this section](https://python-intro.quantecon.org/finite_markov.html#Marginal-Distributions) of our lecture on **finite** Markov chains, we
286+
In [this section](https://python.quantecon.org/finite_markov.html#marginal-distributions) of our lecture on **finite** Markov chains, we
287287
asked the following question: If
288288

289289
1. $\{X_t\}$ is a Markov chain with stochastic matrix $P$
@@ -292,7 +292,7 @@ asked the following question: If
292292
then what is the distribution of $X_{t+1}$?
293293

294294
Letting $\psi_{t+1}$ denote the distribution of $X_{t+1}$, the
295-
answer [we gave](https://python-intro.quantecon.org/finite_markov.html#Marginal-Distributions) was that
295+
answer [we gave](https://python.quantecon.org/finite_markov.html#marginal-distributions) was that
296296

297297
$$
298298
\psi_{t+1}[j] = \sum_{i \in S} P[i,j] \psi_t[i]
@@ -333,7 +333,7 @@ This operator is usually called the *Markov operator* corresponding to $p$
333333
Unlike most operators, we write $P$ to the right of its argument,
334334
instead of to the left (i.e., $\psi P$ instead of $P \psi$).
335335
This is a common convention, with the intention being to maintain the
336-
parallel with the finite case --- see [here](https://python-intro.quantecon.org/finite_markov.html#Marginal-Distributions)
336+
parallel with the finite case --- see [here](https://python.quantecon.org/finite_markov.html#marginal-distributions)
337337
```
338338

339339
With this notation, we can write {eq}`statd_fdd` more succinctly as $\psi_{t+1}(y) = (\psi_t P)(y)$ for all $y$, or, dropping the $y$ and letting "$=$" indicate equality of functions,
@@ -516,7 +516,7 @@ Notice that the sequence of densities shown in the figure seems to be
516516
converging --- more on this in just a moment.
517517

518518
Another quick comment is that each of these distributions could be interpreted
519-
as a cross-sectional distribution (recall [this discussion](https://python-intro.quantecon.org/finite_markov.html#Example-2:-Cross-Sectional-Distributions)).
519+
as a cross-sectional distribution (recall [this discussion](https://python.quantecon.org/finite_markov.html#example-2-cross-sectional-distributions)).
520520

521521
## Beyond Densities
522522

@@ -606,7 +606,7 @@ The general case is relatively similar --- references are given below.
606606

607607
### Theoretical Results
608608

609-
Analogous to [the finite case](https://python-intro.quantecon.org/finite_markov.html#Stationary-Distributions), given a stochastic kernel $p$ and corresponding Markov operator as
609+
Analogous to [the finite case](https://python.quantecon.org/finite_markov.html#stationary-distributions), given a stochastic kernel $p$ and corresponding Markov operator as
610610
defined in {eq}`def_dmo`, a density $\psi^*$ on $S$ is called
611611
*stationary* for $P$ if it is a fixed point of the operator $P$.
612612

0 commit comments

Comments
 (0)