Skip to content

Commit 211da0a

Browse files
committed
Merge remote-tracking branch 'origin/main' into update_business_cycle
2 parents 43e319b + ffebfb9 commit 211da0a

42 files changed

Lines changed: 4767 additions & 1399 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,22 @@
44
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
55

66
version: 2
7+
enable-beta-ecosystems: true
78
updates:
89
- package-ecosystem: github-actions
910
directory: /
1011
commit-message:
1112
prefix: ⬆️
1213
schedule:
1314
interval: weekly
15+
- package-ecosystem: "conda"
16+
directory: "/"
17+
commit-message:
18+
prefix: ⬆️
19+
schedule:
20+
interval: "weekly"
21+
ignore:
22+
- dependency-name: "jupyter-book"
23+
versions: [">=2.0"]
24+
- dependency-name: "python"
25+
# Python version should be constrained by the anaconda distribution version

.github/workflows/cache.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@v6
13+
with:
14+
fetch-depth: 0
1315
- name: Setup Anaconda
14-
uses: conda-incubator/setup-miniconda@v3
16+
uses: conda-incubator/setup-miniconda@v4
1517
with:
1618
auto-update-conda: true
1719
auto-activate-base: true
@@ -40,13 +42,13 @@ jobs:
4042
run: |
4143
jb build lectures --path-output ./ -W --keep-going
4244
- name: Upload Execution Reports (HTML)
43-
uses: actions/upload-artifact@v4
45+
uses: actions/upload-artifact@v7
4446
if: failure()
4547
with:
4648
name: execution-reports
4749
path: _build/html/reports
4850
- name: Upload "_build" folder (cache)
49-
uses: actions/upload-artifact@v4
51+
uses: actions/upload-artifact@v7
5052
with:
5153
name: build-cache
5254
path: _build

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- name: Checkout
8-
uses: actions/checkout@v4
8+
uses: actions/checkout@v6
9+
with:
10+
fetch-depth: 0
911
- name: Setup Anaconda
10-
uses: conda-incubator/setup-miniconda@v3
12+
uses: conda-incubator/setup-miniconda@v4
1113
with:
1214
auto-update-conda: true
1315
auto-activate-base: true
@@ -38,7 +40,7 @@ jobs:
3840
shell: bash -l {0}
3941
run: pip list
4042
- name: Download "build" folder (cache)
41-
uses: dawidd6/action-download-artifact@v11
43+
uses: dawidd6/action-download-artifact@v21
4244
with:
4345
workflow: cache.yml
4446
branch: main
@@ -52,7 +54,7 @@ jobs:
5254
mkdir -p _build/html/_pdf
5355
cp -u _build/latex/*.pdf _build/html/_pdf
5456
- name: Upload Execution Reports (LaTeX)
55-
uses: actions/upload-artifact@v4
57+
uses: actions/upload-artifact@v7
5658
if: failure()
5759
with:
5860
name: execution-reports
@@ -72,7 +74,7 @@ jobs:
7274
rm -r _build/.doctrees
7375
jb build lectures --path-output ./ -nW --keep-going
7476
- name: Upload Execution Reports (HTML)
75-
uses: actions/upload-artifact@v4
77+
uses: actions/upload-artifact@v7
7678
if: failure()
7779
with:
7880
name: execution-reports

.github/workflows/collab.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
container:
88
image: us-docker.pkg.dev/colab-images/public/runtime:latest
99
steps:
10-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v6
1111
with:
1212
ref: ${{ github.event.pull_request.head.sha }}
1313
- name: Check for dockerenv file
@@ -20,7 +20,7 @@ jobs:
2020
shell: bash -l {0}
2121
run: pip list
2222
- name: Download "build" folder (cache)
23-
uses: dawidd6/action-download-artifact@v11
23+
uses: dawidd6/action-download-artifact@v21
2424
with:
2525
workflow: cache.yml
2626
branch: main
@@ -30,14 +30,14 @@ jobs:
3030
- name: Install Build Software
3131
shell: bash -l {0}
3232
run: |
33-
pip install jupyter-book==0.15.1 docutils==0.17.1 quantecon-book-theme==0.7.2 sphinx-tojupyter==0.3.0 sphinxext-rediraffe==0.2.7 sphinx-exercise==0.4.1 sphinxcontrib-youtube==1.1.0 sphinx-togglebutton==0.3.1 arviz==0.13.0 sphinx_proof==0.2.0 sphinx_reredirects==0.1.3
33+
pip install jupyter-book==1.0.4post1 quantecon-book-theme==0.20.2 sphinx-tojupyter==0.6.0 sphinxext-rediraffe==0.3.0 sphinx-exercise==1.2.1 sphinxcontrib-youtube==1.4.1 sphinx-togglebutton==0.4.5 sphinx_proof==0.4.0 sphinx_reredirects==1.1.0
3434
# Build of HTML (Execution Testing)
3535
- name: Build HTML
3636
shell: bash -l {0}
3737
run: |
3838
jb build lectures --path-output ./ -n -W --keep-going
3939
- name: Upload Execution Reports
40-
uses: actions/upload-artifact@v4
40+
uses: actions/upload-artifact@v7
4141
if: failure()
4242
with:
4343
name: execution-reports

.github/workflows/linkcheck.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
# Checkout the live site (html)
1515
- name: Checkout
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v6
1717
with:
1818
ref: gh-pages
1919
- name: Link Checker
@@ -24,7 +24,7 @@ jobs:
2424
args: --accept 403,503 *.html
2525
- name: Create Issue From File
2626
if: steps.lychee.outputs.exit_code != 0
27-
uses: peter-evans/create-issue-from-file@v5
27+
uses: peter-evans/create-issue-from-file@v6
2828
with:
2929
title: Link Checker Report
3030
content-filepath: ./lychee/out.md

.github/workflows/publish.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@v6
13+
with:
14+
fetch-depth: 0
1315
- name: Setup Anaconda
14-
uses: conda-incubator/setup-miniconda@v3
16+
uses: conda-incubator/setup-miniconda@v4
1517
with:
1618
auto-update-conda: true
1719
auto-activate-base: true
@@ -39,7 +41,7 @@ jobs:
3941
shell: bash -l {0}
4042
run: pip list
4143
- name: Download "build" folder (cache)
42-
uses: dawidd6/action-download-artifact@v11
44+
uses: dawidd6/action-download-artifact@v21
4345
with:
4446
workflow: cache.yml
4547
branch: main
@@ -72,6 +74,32 @@ jobs:
7274
run: |
7375
rm -r _build/.doctrees
7476
jb build lectures --path-output ./
77+
# Create HTML archive for release assets
78+
- name: Create HTML archive
79+
shell: bash -l {0}
80+
run: |
81+
tar -czf lecture-python-intro-html-${{ github.ref_name }}.tar.gz -C _build/html .
82+
sha256sum lecture-python-intro-html-${{ github.ref_name }}.tar.gz > html-checksum.txt
83+
84+
# Create metadata manifest
85+
cat > html-manifest.json << EOF
86+
{
87+
"tag": "${{ github.ref_name }}",
88+
"commit": "${{ github.sha }}",
89+
"timestamp": "$(date -Iseconds)",
90+
"size_mb": $(du -sm _build/html | cut -f1),
91+
"file_count": $(find _build/html -type f | wc -l)
92+
}
93+
EOF
94+
- name: Upload archives to release
95+
uses: softprops/action-gh-release@v3
96+
with:
97+
files: |
98+
lecture-python-intro-html-${{ github.ref_name }}.tar.gz
99+
html-checksum.txt
100+
html-manifest.json
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75103
- name: Deploy to Netlify
76104
uses: nwtgck/actions-netlify@v3.0
77105
with:
@@ -89,7 +117,7 @@ jobs:
89117
publish_dir: _build/html/
90118
cname: intro.quantecon.org
91119
- name: Upload "_build" folder (cache)
92-
uses: actions/upload-artifact@v4
120+
uses: actions/upload-artifact@v7
93121
with:
94122
name: build-publish
95123
path: _build

environment.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ channels:
33
- default
44
dependencies:
55
- python=3.13
6-
- anaconda=2025.06
6+
- anaconda=2025.12
77
- pip
88
- pip:
99
- jupyter-book==1.0.4post1
10-
- quantecon-book-theme==0.8.3
11-
- sphinx-tojupyter==0.3.1
12-
- sphinxext-rediraffe==0.2.7
13-
- sphinx-exercise==1.0.1
14-
- sphinx-proof==0.2.1
15-
- sphinxcontrib-youtube==1.4.1
16-
- sphinx-togglebutton==0.3.2
17-
- sphinx-reredirects==1.0.0
10+
- quantecon-book-theme==0.20.3
11+
- sphinx-tojupyter==0.6.0
12+
- sphinxext-rediraffe==0.3.0
13+
- sphinx-exercise==1.2.1
14+
- sphinx-proof==0.4.0
15+
- sphinxcontrib-youtube==1.5.0
16+
- sphinx-togglebutton==0.4.5
17+
- sphinx-reredirects==1.1.0
1818

1919

lectures/_config.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,40 @@ sphinx:
4444
nb_render_image_options:
4545
width: 80%
4646
nb_code_prompt_show: "Show {type}"
47+
nb_merge_streams: true
48+
nb_mime_priority_overrides: [
49+
# HTML
50+
['html', 'application/vnd.jupyter.widget-view+json', 10],
51+
['html', 'application/javascript', 20],
52+
['html', 'text/html', 30],
53+
['html', 'text/latex', 40],
54+
['html', 'image/svg+xml', 50],
55+
['html', 'image/png', 60],
56+
['html', 'image/jpeg', 70],
57+
['html', 'text/markdown', 80],
58+
['html', 'text/plain', 90],
59+
# Jupyter Notebooks
60+
['jupyter', 'application/vnd.jupyter.widget-view+json', 10],
61+
['jupyter', 'application/javascript', 20],
62+
['jupyter', 'text/html', 30],
63+
['jupyter', 'text/latex', 40],
64+
['jupyter', 'image/svg+xml', 50],
65+
['jupyter', 'image/png', 60],
66+
['jupyter', 'image/jpeg', 70],
67+
['jupyter', 'text/markdown', 80],
68+
['jupyter', 'text/plain', 90],
69+
# LaTeX
70+
['latex', 'text/latex', 10],
71+
['latex', 'application/pdf', 20],
72+
['latex', 'image/png', 30],
73+
['latex', 'image/jpeg', 40],
74+
['latex', 'text/markdown', 50],
75+
['latex', 'text/plain', 60],
76+
# Link Checker
77+
['linkcheck', 'text/plain', 10],
78+
]
4779
suppress_warnings: [mystnb.unknown_mime_type, myst.domains]
80+
# sphinx-proof
4881
proof_minimal_theme: true
4982
# -------------
5083
html_js_files:
@@ -63,6 +96,7 @@ sphinx:
6396
header_organisation: QuantEcon
6497
repository_url: https://github.com/QuantEcon/lecture-python-intro
6598
nb_repository_url: https://github.com/QuantEcon/lecture-python-intro.notebooks
99+
path_to_docs: lectures
66100
twitter: quantecon
67101
twitter_logo_url: https://assets.quantecon.org/img/qe-twitter-logo.png
68102
og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png
1 Byte
Loading

lectures/ar1_processes.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ These simple models are used again and again in economic research to represent t
3636
* productivity, etc.
3737

3838
We are going to study AR(1) processes partly because they are useful and
39-
partly because they help us understand important concepts.
39+
partly because they help us understand important concepts.
4040

4141
Let's start with some imports:
4242

@@ -56,14 +56,14 @@ The **AR(1) model** (autoregressive model of order 1) takes the form
5656
X_{t+1} = a X_t + b + c W_{t+1}
5757
```
5858

59-
where $a, b, c$ are scalar-valued parameters
59+
where $a, b, c$ are scalar-valued parameters
6060

6161
(Equation {eq}`can_ar1` is sometimes called a **stochastic difference equation**.)
6262

6363
```{prf:example}
6464
:label: ar1_ex_ar
6565
66-
For example, $X_t$ might be
66+
For example, $X_t$ might be
6767
6868
* the log of labor income for a given household, or
6969
* the log of money demand in a given economy.
@@ -356,9 +356,7 @@ In this equation, we can use observed data to evaluate the left hand side of {eq
356356

357357
And we can use a theoretical AR(1) model to calculate the right hand side.
358358

359-
If $\frac{1}{m} \sum_{t = 1}^m X_t$ is not close to $\psi^(x)$, even for many
360-
observations, then our theory seems to be incorrect and we will need to revise
361-
it.
359+
If $\frac{1}{m} \sum_{t = 1}^m h(X_t)$ is not close to $\int h(x)\psi^*(x) dx$, even for many observations, then our theory seems to be incorrect and we will need to revise it.
362360

363361

364362
## Exercises
@@ -427,8 +425,8 @@ def true_moments_ar1(k):
427425
return 0
428426
429427
k_vals = np.arange(6) + 1
430-
sample_moments = np.empty_like(k_vals)
431-
true_moments = np.empty_like(k_vals)
428+
sample_moments = np.empty(len(k_vals), dtype=float)
429+
true_moments = np.empty(len(k_vals), dtype=float)
432430
433431
for k_idx, k in enumerate(k_vals):
434432
sample_moments[k_idx] = sample_moments_ar1(k)
@@ -464,8 +462,8 @@ $$
464462
For $K$ use the Gaussian kernel ($K$ is the standard normal
465463
density).
466464
467-
Write the class so that the bandwidth defaults to Silvermans rule (see
468-
the rule of thumb discussion on [this
465+
Write the class so that the bandwidth defaults to Silverman's rule (see
466+
the "rule of thumb" discussion on [this
469467
page](https://en.wikipedia.org/wiki/Kernel_density_estimation)). Test
470468
the class you have written by going through the steps
471469

0 commit comments

Comments
 (0)