Skip to content

Conversation

shlff
Copy link
Member

@shlff shlff commented Jun 3, 2023

Hi @jstac this PR updates code and context in lecture supply_demand_multiple_goods.

The code and example are partially shifted and simplified from the lecture supply_demand_heterogeneity.

Looking forward to your comments.

@netlify
Copy link

netlify bot commented Jun 3, 2023

Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit d0166ab
🔍 Latest deploy log https://app.netlify.com/sites/taupe-gaufre-c4e660/deploys/647c4734fa1d180008397527
😎 Deploy Preview https://deploy-preview-219--taupe-gaufre-c4e660.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Jun 3, 2023

@@ -171,6 +191,57 @@ Verify that setting $\mu=2$ in {eq}`eq:old3` also implies that formula

```

```{code-cell} ipython3
Copy link
Member Author

@shlff shlff Jun 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class ExchangeEconomyand its examples are shifted from lecture supply_demand_heterogeneity and simplified under the current setup (TODO need to be verified again).

+++

Here is an instance of the risk economy:

Copy link
Member Author

@shlff shlff Jun 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example and exercise are followed from Tom's advice on exercises in the text.

Here we define a class ``ProductionEconomy``.

```{code-cell} ipython3
class ProductionEconomy:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class ProductionEconomy and its examples are moved directly from the lecture supply_demand_heterogeneity.

I suggest we delete this class in the lecture supply_demand_heterogeneity in the following PR:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree @shlff

plt.show()
```

#### Example: Single Agent with One Good and with Production
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These examples, which are for single agent and single good, could be linked back to supply_demand_intro.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, only if you have time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change capitalization of section titles: https://manual.quantecon.org/styleguide/writing.html#titles-and-headings

Thanks @jstac . Done.


Then define a function that plots demand and supply curves and labels surpluses and equilibrium.

```{code-cell} ipython3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we hide the code cell here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea @shlff

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Here is a function that plots the demand, marginal cost and marginal revenue curves with surpluses and equilibrium labelled.

```{code-cell} ipython3
def plot_monopoly(PE):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could hide the code cell here as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

@jstac
Copy link
Contributor

jstac commented Jun 3, 2023

Change capitalization of section titles: https://manual.quantecon.org/styleguide/writing.html#titles-and-headings

@jstac
Copy link
Contributor

jstac commented Jun 3, 2023

In code, change Pi to $\Pi$ and Pi_inv to $\Pi$_inv

@jstac
Copy link
Contributor

jstac commented Jun 3, 2023

Before the code cell that starts "class ExchangeEconomy:", please add "Here is a class that computes competitive equilibria for our economy."

@jstac
Copy link
Contributor

jstac commented Jun 3, 2023

Great job @shlff ! Please see my minor comments above.

@shlff
Copy link
Member Author

shlff commented Jun 4, 2023

In code, change Pi to Π and Pi_inv to $\Pi$_inv

Done. Also I changed mu to $\mu$.

Same applied to:

Before the code cell that starts "class ExchangeEconomy:", please add "Here is a class that computes competitive equilibria for our economy."

Done.

Copy link
Member Author

@shlff shlff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jstac . I've made the changes as you suggested as well as some additional improvements.

This PR is ready for review. Here is a preview:

Looking forward to your further comments.

In a single good case, this equilibrium is associated with a higher price of the good.

```{code-cell} ipython3
class Monopoly(ProductionEconomy):
Copy link
Member Author

@shlff shlff Jun 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your advice today @jstac .

Here I define an inheritance class called Monopoly from the class ProductionEconomy.

@jstac
Copy link
Contributor

jstac commented Jun 4, 2023

Very good work @shlff , many thanks. This is looking good.

@jstac jstac merged commit d485165 into main Jun 4, 2023
@jstac jstac deleted the ds_multiple branch June 4, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants