From 675af1452d492fad2ce5662149f8d4a46ef41233 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 12 Mar 2024 10:12:24 +1100 Subject: [PATCH 1/8] upgrade to anaconda=2024.02 --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 5792c991..52036b80 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: - conda-forge dependencies: - python=3.11 - - anaconda=2023.09 + - anaconda=2024.02 - pip - pip: - jupyter-book==0.15.1 From f1d0069ff81d32d532247d4d05fa3523d22edcd2 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 12 Mar 2024 10:13:46 +1100 Subject: [PATCH 2/8] update to standard readme --- README.md | 46 ++++++++++------------------------------------ 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 6701534b..43c21f23 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,16 @@ -# lecture-python-intro +# A First Course in Quantitative Economics with Python -An undergraduate lecture series for the foundations of computational economics +An Undergraduate Lecture Series for the Foundations of Computational Economics -## Content ideas +## Jupyter notebooks -Content ideas in no particular order. +Jupyter notebook versions of each lecture are available for download +via the website. -Open individual issues and PRs for the ones we decide to add. +## Contributions - 1. Geometric Series (existing lecture) - 2. Leontief Systems (from Networks Book) - 3. Luenberger - 4. IO Visualizations (from Networks Book) - 5. PyPGM (Eileen Nielson ... Youtube Star) - 6. Baby Version of https://python.quantecon.org/re_with_feedback.html (Cagan Model) - 7. Baby Version of "unpleasant arithmetic and Friedmans optimal quantity of money" - 8. Schelling Segregation Model - 9. Solow Model - 10. Simulations of Wealth Distribution - 11. Baby model of Lake Model (Eigenvalue Extension) - 12. Diamond Dybvig Model - 13. Moral Harzard - Wallace - 14. Philips Curve and Nairu - 15. Baby version of the Markov Chain Lecture - 16. Baby linear programming lecture - 17. Basic Nonlinear Demand and Supply (non-linear solver) OOP lecture - 18. Asset Pricing (Harrison/Kreps Model) - 19. Two Models of Asset Bubbles - 20. cobweb model -- start people thinking about expectations - 21. social mobility lecture - 22. Baby version of cattle cycles model - 23. Bi-matrix games. - 24. Shortest path lecture (existing) - 25. Pricing an American option - 26. Baby version of LLN / CLT lecture --- less maths, more simulation, all in one dimension - 27. Baby version of heavy tails lecture - 30. Lecture on solving linear equations and matrix algebra - 31. Lecture on eigenvalues, Perron-Frobenius and the Neumann series lemma - 32. Overlapping generations +To comment on the lectures please add to or open an issue in the issue tracker (see above). -Get Tom's network intermediary paper. +We welcome pull requests! + +Please read the [QuantEcon style guide](https://manual.quantecon.org/intro.html) first, so that you can match our style. From 74bdebe56cde7d7077416fe68cba5820f10b2bed Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 12 Mar 2024 10:39:15 +1100 Subject: [PATCH 3/8] update status page with diagnostic information --- lectures/status.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lectures/status.md b/lectures/status.md index 8309f510..44ffabbf 100644 --- a/lectures/status.md +++ b/lectures/status.md @@ -1,3 +1,4 @@ + --- jupytext: text_representation: @@ -18,6 +19,17 @@ This table contains the latest execution statistics. (status:machine-details)= -These lectures are built on `linux` instances through `github actions` and `amazon web services (aws)` to -enable access to a `gpu`. These lectures are built on a [p3.2xlarge](https://aws.amazon.com/ec2/instance-types/p3/) -that has access to `8 vcpu's`, a `V100 NVIDIA Tesla GPU`, and `61 Gb` of memory. \ No newline at end of file +These lectures are built on `linux` instances through `github actions`. + +These lectures are using the following python version + +```{code-cell} ipython +!python --version +``` + +and the following package versions + +```{code-cell} ipython +:tags: [hide-output] +!conda list +``` \ No newline at end of file From 81a092ba3db1f9a5977ba668b7e8898987e10df5 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 12 Mar 2024 10:50:56 +1100 Subject: [PATCH 4/8] fix space --- lectures/status.md | 1 - 1 file changed, 1 deletion(-) diff --git a/lectures/status.md b/lectures/status.md index 44ffabbf..3ada25f0 100644 --- a/lectures/status.md +++ b/lectures/status.md @@ -1,4 +1,3 @@ - --- jupytext: text_representation: From b86309502144e821ec0331bbe36dffd73339b621 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 12 Mar 2024 10:55:02 +1100 Subject: [PATCH 5/8] update reference style --- lectures/_config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/lectures/_config.yml b/lectures/_config.yml index 348a1881..407cc295 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -37,6 +37,7 @@ latex: sphinx: extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_exercise, sphinx_togglebutton, sphinx.ext.intersphinx, sphinx_proof, sphinx_tojupyter] config: + bibtex_reference_style: author_year # false-positive links linkcheck_ignore: ['https://doi.org/https://doi.org/10.2307/1235116', 'https://math.stackexchange.com/*', 'https://stackoverflow.com/*'] # myst-nb config From 7a09aaefa0cd5a50f084b74f27600ea59d01d27c Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 12 Mar 2024 14:33:44 +1100 Subject: [PATCH 6/8] tmp: disable build cache for full build --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e9c5e60..49759bb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,13 +37,13 @@ jobs: - name: Display Pip Versions shell: bash -l {0} run: pip list - - name: Download "build" folder (cache) - uses: dawidd6/action-download-artifact@v2 - with: - workflow: cache.yml - branch: main - name: build-cache - path: _build + # - name: Download "build" folder (cache) + # uses: dawidd6/action-download-artifact@v2 + # with: + # workflow: cache.yml + # branch: main + # name: build-cache + # path: _build # Build Assets (Download Notebooks and PDF via LaTeX) - name: Build PDF from LaTeX shell: bash -l {0} From ddb184a5cc7ad3868b9abb8cf5e9790cb3c33fcb Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 18 Mar 2024 14:58:03 +1100 Subject: [PATCH 7/8] remove interpolation in lecture series --- lectures/heavy_tails.md | 5 ++--- lectures/inequality.md | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lectures/heavy_tails.md b/lectures/heavy_tails.md index 440eab71..df111e9d 100644 --- a/lectures/heavy_tails.md +++ b/lectures/heavy_tails.md @@ -19,7 +19,7 @@ In addition to what's in Anaconda, this lecture will need the following librarie ```{code-cell} ipython3 :tags: [hide-output] -!pip install --upgrade yfinance pandas_datareader interpolation +!pip install --upgrade yfinance pandas_datareader ``` We use the following imports. @@ -31,7 +31,6 @@ import yfinance as yf import pandas as pd import statsmodels.api as sm -from interpolation import interp from pandas_datareader import wb from scipy.stats import norm, cauchy from pandas.plotting import register_matplotlib_converters @@ -602,7 +601,7 @@ def empirical_ccdf(data, fw = np.empty_like(aw, dtype='float64') for i, a in enumerate(aw): fw[i] = a / np.sum(aw) - pdf = lambda x: interp(data, fw, x) + pdf = lambda x: np.interp(x, data, fw) data = np.sort(data) j = 0 for i, d in enumerate(data): diff --git a/lectures/inequality.md b/lectures/inequality.md index ee006a15..0d59aa53 100644 --- a/lectures/inequality.md +++ b/lectures/inequality.md @@ -68,7 +68,7 @@ We will install the following libraries. ```{code-cell} ipython3 :tags: [hide-output] -!pip install --upgrade quantecon interpolation +!pip install quantecon ``` And we use the following imports. @@ -79,7 +79,6 @@ import numpy as np import matplotlib.pyplot as plt import quantecon as qe import random as rd -from interpolation import interp ``` ## The Lorenz curve @@ -746,7 +745,7 @@ Here is one solution: ```{code-cell} ipython3 def lorenz2top(f_val, l_val, p=0.1): - t = lambda x: interp(f_val, l_val, x) + t = lambda x: np.interp(x, f_val, l_val) return 1- t(1 - p) ``` From f688cb4d7d8a22d6b5e75dd3588cc5d950b718ee Mon Sep 17 00:00:00 2001 From: mmcky Date: Mon, 18 Mar 2024 16:19:24 +1100 Subject: [PATCH 8/8] Revert "tmp: disable build cache for full build" This reverts commit 7a09aaefa0cd5a50f084b74f27600ea59d01d27c. --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49759bb2..5e9c5e60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,13 +37,13 @@ jobs: - name: Display Pip Versions shell: bash -l {0} run: pip list - # - name: Download "build" folder (cache) - # uses: dawidd6/action-download-artifact@v2 - # with: - # workflow: cache.yml - # branch: main - # name: build-cache - # path: _build + - name: Download "build" folder (cache) + uses: dawidd6/action-download-artifact@v2 + with: + workflow: cache.yml + branch: main + name: build-cache + path: _build # Build Assets (Download Notebooks and PDF via LaTeX) - name: Build PDF from LaTeX shell: bash -l {0}