Skip to content

Commit 6974827

Browse files
authored
Merge branch 'main' into i-524
2 parents 731dec1 + 39b39c9 commit 6974827

Some content is hidden

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

44 files changed

+1184
-306
lines changed

.github/workflows/cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
auto-update-conda: true
1818
auto-activate-base: true
1919
miniconda-version: 'latest'
20-
python-version: "3.12"
20+
python-version: "3.13"
2121
environment-file: environment.yml
2222
activate-environment: quantecon
2323
- name: Install JAX, Numpyro, PyTorch

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
auto-update-conda: true
1616
auto-activate-base: true
1717
miniconda-version: 'latest'
18-
python-version: "3.12"
18+
python-version: "3.13"
1919
environment-file: environment.yml
2020
activate-environment: quantecon
2121
- name: Install JAX, Numpyro, PyTorch
@@ -53,7 +53,7 @@ jobs:
5353
uses: actions/upload-artifact@v4
5454
if: failure()
5555
with:
56-
name: execution-reports
56+
name: execution-reports-notebooks
5757
path: _build/jupyter/reports
5858
- name: Build PDF from LaTeX
5959
shell: bash -l {0}

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
auto-update-conda: true
1717
auto-activate-base: true
1818
miniconda-version: 'latest'
19-
python-version: "3.12"
19+
python-version: "3.13"
2020
environment-file: environment.yml
2121
activate-environment: quantecon
2222
- name: Install JAX, Numpyro, PyTorch

environment.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ name: quantecon
22
channels:
33
- default
44
dependencies:
5-
- python=3.12
6-
- anaconda=2024.10
5+
- python=3.13
6+
- anaconda=2025.06
77
- pip
88
- pip:
9-
- jupyter-book==1.0.3
10-
- quantecon-book-theme==0.7.6
11-
- sphinx-tojupyter==0.3.0
9+
- jupyter-book==1.0.4post1
10+
- quantecon-book-theme==0.9.0
11+
- sphinx-tojupyter==0.3.1
1212
- sphinxext-rediraffe==0.2.7
13-
- sphinx-reredirects==0.1.4
1413
- sphinx-exercise==1.0.1
15-
- sphinx-proof==0.2.0
16-
- ghp-import==1.1.0
17-
- sphinxcontrib-youtube==1.3.0 #Version 1.3.0 is required as quantecon-book-theme is only compatible with sphinx<=5
14+
- sphinx-proof==0.2.1
15+
- sphinxcontrib-youtube==1.4.1
1816
- sphinx-togglebutton==0.3.2
17+
- sphinx-reredirects==0.1.4
18+
19+

lectures/_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ sphinx:
3737
# false-positive links
3838
linkcheck_ignore: ['https://online.stat.psu.edu/stat415/book/export/html/834']
3939
bibtex_reference_style: author_year
40+
suppress_warnings: ["mystnb.unknown_mime_type"]
4041
nb_mime_priority_overrides: [
4142
# HTML
4243
['html', 'application/vnd.jupyter.widget-view+json', 10],
@@ -97,6 +98,9 @@ sphinx:
9798
advanced:
9899
- "https://python-advanced.quantecon.org"
99100
- null
101+
jax:
102+
- "https://jax.quantecon.org/"
103+
- null
100104
mathjax3_config:
101105
tex:
102106
macros:

lectures/_static/quant-econ.bib

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
Note: Extended Information (like abstracts, doi, url's etc.) can be found in quant-econ-extendedinfo.bib file in _static/
44
###
55
6+
@article{blume2018case,
7+
title={A case for incomplete markets},
8+
author={Blume, Lawrence E and Cogley, Timothy and Easley, David A and Sargent, Thomas J and Tsyrennikov, Viktor},
9+
journal={Journal of Economic Theory},
10+
volume={178},
11+
pages={191--221},
12+
year={2018},
13+
publisher={Elsevier}
14+
}
15+
616
@article{shannon1948mathematical,
717
title={A mathematical theory of communication},
818
author={Shannon, Claude E},

lectures/aiyagari.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ Let's start with some imports:
5757

5858
```{code-cell} ipython3
5959
import matplotlib.pyplot as plt
60-
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
6160
import numpy as np
6261
from quantecon.markov import DiscreteDP
6362
from numba import jit

lectures/back_prop.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,17 @@ kernelspec:
1616
```{include} _admonition/gpu.md
1717
```
1818

19-
```{code-cell} ipython3
20-
:tags: [skip-execution]
21-
22-
!pip install --upgrade jax
23-
```
24-
25-
```{code-cell} ipython3
26-
import jax
27-
## to check that gpu is activated in environment
28-
print(f"JAX backend: {jax.devices()[0].platform}")
29-
```
30-
3119
In addition to what's included in base Anaconda, we need to install the following packages
3220

3321
```{code-cell} ipython3
3422
:tags: [hide-output]
3523
36-
!pip install kaleido
37-
!conda install -y -c plotly plotly plotly-orca retrying
24+
!pip install -U kaleido plotly
25+
!conda install -y -c plotly plotly-orca
26+
27+
# kaleido needs chrome to build images
28+
import kaleido
29+
kaleido.get_chrome_sync()
3830
```
3931

4032
```{note}
@@ -44,6 +36,19 @@ the Python packages. However this lecture will still execute as Google Colab
4436
has `plotly` installed.
4537
```
4638

39+
We also need to install JAX to run this lecture
40+
41+
```{code-cell} ipython3
42+
:tags: [skip-execution]
43+
44+
!pip install --upgrade jax
45+
```
46+
47+
```{code-cell} ipython3
48+
import jax
49+
print(f"JAX backend: {jax.devices()[0].platform}") # to check that gpu is activated in environment
50+
```
51+
4752
## Overview
4853

4954
Substantial parts of **machine learning** and **artificial intelligence** are about

lectures/cake_eating_problem.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ In what follows, we require the following imports:
4141

4242
```{code-cell} ipython
4343
import matplotlib.pyplot as plt
44-
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
4544
import numpy as np
4645
```
4746

48-
## The Model
47+
## The model
4948

5049
We consider an infinite time horizon $t=0, 1, 2, 3..$
5150

@@ -115,7 +114,7 @@ In this problem, the following terminology is standard:
115114
* $c_t$ is called the **control variable** or the **action**
116115
* $\beta$ and $\gamma$ are **parameters**
117116

118-
### Trade-Off
117+
### Trade-off
119118

120119
The key trade-off in the cake-eating problem is this:
121120

@@ -145,14 +144,14 @@ parameters*.
145144

146145
Let's see if this is true.
147146

148-
## The Value Function
147+
## The value function
149148

150149
The first step of our dynamic programming treatment is to obtain the Bellman
151150
equation.
152151

153152
The next step is to use it to calculate the solution.
154153

155-
### The Bellman Equation
154+
### The Bellman equation
156155

157156
To this end, we let $v(x)$ be maximum lifetime utility attainable from
158157
the current time when $x$ units of cake are left.
@@ -199,7 +198,7 @@ If $c$ is chosen optimally using this trade off strategy, then we obtain maximal
199198

200199
Hence, $v(x)$ equals the right hand side of {eq}`bellman-cep`, as claimed.
201200

202-
### An Analytical Solution
201+
### An analytical solution
203202

204203
It has been shown that, with $u$ as the CRRA utility function in
205204
{eq}`crra_utility`, the function
@@ -249,7 +248,7 @@ ax.legend(fontsize=12)
249248
plt.show()
250249
```
251250

252-
## The Optimal Policy
251+
## The optimal policy
253252

254253
Now that we have the value function, it is straightforward to calculate the
255254
optimal action at each state.
@@ -309,7 +308,7 @@ ax.legend()
309308
plt.show()
310309
```
311310

312-
## The Euler Equation
311+
## The Euler equation
313312

314313
In the discussion above we have provided a complete solution to the cake
315314
eating problem in the case of CRRA utility.
@@ -323,7 +322,7 @@ Euler equation.
323322
This is because, for more difficult problems, this equation
324323
provides key insights that are hard to obtain by other methods.
325324

326-
### Statement and Implications
325+
### Statement and implications
327326

328327
The Euler equation for the present problem can be stated as
329328

@@ -376,7 +375,7 @@ see proposition 2.2 of {cite}`ma2020income`.
376375
The following arguments focus on necessity, explaining why an optimal path or
377376
policy should satisfy the Euler equation.
378377

379-
### Derivation I: A Perturbation Approach
378+
### Derivation I: a perturbation approach
380379

381380
Let's write $c$ as a shorthand for consumption path $\{c_t\}_{t=0}^\infty$.
382381

@@ -444,7 +443,7 @@ $$
444443

445444
This is just the Euler equation.
446445

447-
### Derivation II: Using the Bellman Equation
446+
### Derivation II: using the Bellman equation
448447

449448
Another way to derive the Euler equation is to use the Bellman equation {eq}`bellman-cep`.
450449

lectures/career.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ We begin with some imports:
4848

4949
```{code-cell} ipython
5050
import matplotlib.pyplot as plt
51-
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
5251
import numpy as np
5352
import quantecon as qe
5453
from numba import jit, prange
@@ -370,7 +369,8 @@ when the worker follows the optimal policy.
370369

371370
In particular, modulo randomness, reproduce the following figure (where the horizontal axis represents time)
372371

373-
```{figure} /_static/lecture_specific/career/career_solutions_ex1_py.png
372+
```{image} /_static/lecture_specific/career/career_solutions_ex1_py.png
373+
:align: center
374374
```
375375

376376
```{hint}

0 commit comments

Comments
 (0)