Skip to content

Commit a657229

Browse files
committed
Merge branch 'main' into add_cross_section
2 parents 4ea4668 + 8092924 commit a657229

File tree

5 files changed

+62
-39
lines changed

5 files changed

+62
-39
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ jobs:
3737
- name: Display Pip Versions
3838
shell: bash -l {0}
3939
run: pip list
40-
- name: Download "build" folder (cache)
41-
uses: dawidd6/action-download-artifact@v2
42-
with:
43-
workflow: cache.yml
44-
branch: main
45-
name: build-cache
46-
path: _build
40+
# - name: Download "build" folder (cache)
41+
# uses: dawidd6/action-download-artifact@v2
42+
# with:
43+
# workflow: cache.yml
44+
# branch: main
45+
# name: build-cache
46+
# path: _build
4747
# Build Assets (Download Notebooks and PDF via LaTeX)
4848
# - name: Build PDF from LaTeX
4949
# shell: bash -l {0}
@@ -63,7 +63,7 @@ jobs:
6363
- name: Build HTML
6464
shell: bash -l {0}
6565
run: |
66-
rm -r _build/.doctrees
66+
# rm -r _build/.doctrees
6767
jb build lectures --path-output ./ -W --keep-going
6868
- name: Upload Execution Reports (HTML)
6969
uses: actions/upload-artifact@v2

environment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ dependencies:
66
- anaconda=2022.10
77
- pip
88
- pip:
9-
- jupyter-book==0.13.2
10-
- quantecon-book-theme==0.3.2
11-
- sphinx-tojupyter==0.2.1
9+
- jupyter-book==0.14.0
10+
# - quantecon-book-theme==0.3.2
11+
# - sphinx-tojupyter==0.2.1
1212
- sphinxext-rediraffe==0.2.7
1313
- sphinx-exercise==0.4.1
1414
- sphinx-proof==0.1.3

in-work/supply_demand_foundations_v2.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ Sometimes a Hicksian demand curve is called a **compensated** demand curve in or
218218
219219
We'll discuss these distinct demand curves more below.
220220
221-
## Demand Curve as Constrained Utility Maximization
221+
## Demand Curve Implied by Constrained Utility Maximization
222222
223223
For now, we assume that the budget constraint is {eq}`eq:old2`.
224224
@@ -454,7 +454,7 @@ $$
454454
455455
where $p_i$ is the price of one unit of consumption in state $i$.
456456
457-
The state commodities being traded are often called **Arrow securities**.
457+
The state-contingent commodities being traded are often called **Arrow securities**.
458458
459459
Before the random state of the world $i$ is realized, the consumer sells his/her state-contingent endowment bundle and purchases a state-contingent consumption bundle.
460460
@@ -583,14 +583,14 @@ $$
583583
q = (H + 2 \mu^{-1} \Pi^T \Pi)^{-1} (\mu^{-1} \Pi^\top b - h)
584584
$$ (eq:qmonop)
585585
586-
We'll see that the monopolist sets a **lower output** $q$ than does either a
586+
We'll eventually see that a monopolist sets a **lower output** $q$ than does either a
587587
588588
* planner who chooses $q$ to maximize social welfare
589589
590590
* a competitive equilibrium
591591
592592
593-
**Remark:** We can make exercises asking readers to verify the monopolist's supply curve {eq}`eq:qmonop` and the
593+
**Remark:** We can make exercises asking readers to verify the monopolist's supply curve {eq}`eq:qmonop`.
594594
595595
596596
@@ -629,21 +629,26 @@ Thus, as for the single-good case, with multiple goods a competitive equilib
629629
630630
(This is another version of the first welfare theorem.)
631631
632-
We can read the competitive equilbrium price vector off the inverse demand curve or the inverse supply curve.
632+
We can read a competitive equilbrium price vector from either
633+
634+
* the inverse demand curve, or
635+
636+
* the inverse supply curve
633637
634638
<!-- #endregion -->
635639
636-
## Initial notes to Jiacheng for coding
640+
<!-- #region -->
641+
## Notes about coding strategy
637642
638-
Hi Jiacheng.
643+
639644
640-
These are just some suggestions about how to begin writing code.
645+
Here are some suggestions about how to write our code.
641646
642-
I sketch some things that are "not even pseudo code". Here goes.
647+
I sketch some ideas that are "not even pseudo code".
643648
644649
I recommend that we start "general" and write a Python class that will do "everything".
645650
646-
Once we get that working with a bunch of fun examples, we can then "work backwards" and make some very simple "baby code" that starts with simple cases (e.g., a scalar case) and graduallly builds up to the class.
651+
Once we get that working with a bunch of fun examples, we can then "work backwards" and make some very simple "baby code" that starts with a simple cases (e.g., a scalar case) and graduallly adds functions that we'll ultimately assemble as methods that appear in our class.
647652
648653
The fun thing will be to make some revealing examples.
649654
@@ -664,8 +669,7 @@ I recommend making a Python class with the following attributes:
664669
* an $n \times 1$ nonnegative vector $h$
665670
* an $n \times n$ positive definite matrix $J$
666671
667-
Along the lines of your great suggestion (now incorporated in the main text in the previous cell)
668-
the class would do a test to make sure that $b > > \Pi e $ and raise an exception if it is violated
672+
The class will include a test to make sure that $b > > \Pi e $ and raise an exception if it is violated
669673
(at some threshold level we'd have to specify).
670674
671675
* **A Person** in the form of a pair that consists of
@@ -695,7 +699,7 @@ the class would do a test to make sure that $b > > \Pi e $ and raise an excepti
695699
696700
697701
**Remark:** I don't know whether we want to be simple or fancy in terms of using class inheritance in creating a person or an economy.
698-
702+
<!-- #endregion -->
699703
700704
## Codes and Computation - Written by Jiacheng
701705
@@ -975,7 +979,7 @@ print('Competitive equilibrium allocation:', c_s)
975979

976980
### Production Economy
977981

978-
To compute a competitive equilibrium for a production economy where demand curve is pinned down by the marginal utility of wealth $\mu$, we first solve for the allocation using equation.
982+
To compute a competitive equilibrium for a production economy where demand curve is pinned down by the marginal utility of wealth $\mu$, we first compute an allocation by solving a planning problem.
979983

980984
Then we compute the equilibrium price vector using the inverse demand or supply curve.
981985

@@ -1234,17 +1238,34 @@ print('Competitive equilibrium allocation:', c)
12341238

12351239
### A Monopolist Supplier
12361240

1237-
Let us follow the above digression and consider a monopolist supplier in this economy. We add a method to the `production_economy` class we built above to compute the equilibrium price and allocation when there is a monopolist supplier. Since the supplier now has the price-setting power,
1241+
Let's consider a monopolist supplier.
1242+
1243+
We add a method to the `production_economy` class we built above to compute the equilibrium price and allocation when there is a monopolist supplier.
1244+
1245+
Since the supplier now has the price-setting power
1246+
12381247
- we first compute the optimal quantity that solves the monopolist's profit maximization problem.
1239-
- Then we derive the required price level from the consumer's inverse supply curve.
1248+
- Then we back out an equilibrium price from the consumer's inverse demand curve.
1249+
1250+
Next, we use a graph for the single good case to illustrate the difference between a competitive equilibrium and an equilibrium with a monopolist supplier.
1251+
1252+
Recall that in a competitive equilibrium of the economy, the price-taking supplier equates the marginal revenue $p$ with the marginal cost $h + Hq$.
1253+
1254+
This yields the monopolist's inverse supply curve.
1255+
1256+
A monopolist's marginal revenue is not constant but instead is a non-trivial function of the quantity it sets.
1257+
1258+
The monopolist's marginal revenue is
12401259

1241-
Next, we use a graph for the single good case to illustrate the difference between a competitive equilibrium and an equilibrium with a monopolist supplier. Recall that in a competitive equilibrium of the economy, the price-taking supplier equalizes the marginal revenue $p$ with the marginal cost $h + Hq$. This yields the inverse supply curve. In a monopolist economy, the marginal revenue of the firm is a function of the quantity it chooses:
12421260
$$
12431261
MR(q) = -2\mu^{-1}\Pi^{\top}\Pi q+\mu^{-1}\Pi^{\top}b,
12441262
$$
1245-
which the monopolist supplier equalizes with the marginal cost.
12461263

1247-
Our plot illustrates the fact that the monopolist supplier's equilibrium output is lower than either the competitive equilibrium or the social optimal level. In a single good case, this equilibrium is associated with a higher price of the good.
1264+
which the monopolist equates to its marginal cost.
1265+
1266+
Our plot indicates that the monopolist supplier's equilibrium output is lower than either the competitive equilibrium or the social optimal level.
1267+
1268+
In a single good case, this equilibrium is associated with a higher price of the good.
12481269

12491270
```python
12501271
def plot_monopoly(PE):

lectures/_config.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ sphinx:
3636
extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_exercise, sphinx_togglebutton, sphinx_proof] # sphinx_tojupyter
3737
config:
3838
html_favicon: _static/lectures-favicon.ico
39-
html_theme: quantecon_book_theme
39+
html_theme: sphinx_book_theme
4040
html_static_path: ['_static']
4141
html_theme_options:
42-
header_organisation_url: https://quantecon.org
43-
header_organisation: QuantEcon
42+
# header_organisation_url: https://quantecon.org
43+
# header_organisation: QuantEcon
4444
repository_url: https://github.com/QuantEcon/lecture-python-intro
45-
nb_repository_url: https://github.com/QuantEcon/lecture-python-intro.notebooks
46-
twitter: quantecon
47-
twitter_logo_url: https://assets.quantecon.org/img/qe-twitter-logo.png
48-
og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png
49-
description: This website presents a set of lectures on python programming for economics, designed and written by Thomas J. Sargent and John Stachurski.
50-
keywords: Python, QuantEcon, Quantitative Economics, Economics, Sloan, Alfred P. Sloan Foundation, Tom J. Sargent, John Stachurski
45+
# nb_repository_url: https://github.com/QuantEcon/lecture-python-intro.notebooks
46+
# twitter: quantecon
47+
# twitter_logo_url: https://assets.quantecon.org/img/qe-twitter-logo.png
48+
# og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png
49+
# description: This website presents a set of lectures on python programming for economics, designed and written by Thomas J. Sargent and John Stachurski.
50+
# keywords: Python, QuantEcon, Quantitative Economics, Economics, Sloan, Alfred P. Sloan Foundation, Tom J. Sargent, John Stachurski
5151
# analytics:
5252
# google_analytics_id: UA-54984338-9
5353
launch_buttons:

lectures/inequality.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ plt.title("Gini coefficients of US income data")
506506
plt.show()
507507
```
508508

509+
**TEST ===>** Here is a {ref}`gini_us` and a {numref}`gini_us`
510+
509511
We see that, by this measure, inequality in wealth and income has risen
510512
substantially since 1980.
511513

0 commit comments

Comments
 (0)