Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cagan_adaptive] Update the code suggestions #400

Merged
merged 4 commits into from
Mar 25, 2024
Merged

Conversation

longye-tian
Copy link
Collaborator

Update coding suggestion in issue #392, more specifically, this pull request is related to

  • Set the default values in create_cagan_adaptive_model instead of global parameters. (Some parameters are still global and move to the Experiment 1 section as they are not part of the create_cagan_adaptive_model)
  • change inv to solve (I also modified the name of solve function to solve_cagan_adaptive to avoid confusion with the solve function in np)
  • remove extra print when checking the stability of dynamics.
  • in the section of 14.6. Technical condition for stability and add a new section that focuses on experiments.
  • give names to matrices and equations so that they can be referred in the code comment (I add comment in code to suggest matrix D is the coefficient matrix of equation (14.8))
  • Add comments in this function and give titles to subplots.
  • Change subtitle "Forcast error" -> "Forcast error and model computation"
  • Change the time notations for equations in the section "Experiment 1"

Update coding suggestion in issue #392, more specifically, this pull request is related to
- Set the default values in  `create_cagan_adaptive_model` instead of global parameters. (Some parameters are still global and move to the Experiment 1 section as they are not part of the `create_cagan_adaptive_model`)
- change `inv` to `solve` (I also modified the name of `solve` function to `solve_cagan_adaptive` to avoid confusion with the `solve` function in `np`)
- remove extra print when checking the stability of dynamics.
- in the section of 14.6. Technical condition for stability and add a new section that focuses on experiments.
- give names to matrices and equations so that they can be referred in the code comment (I add comment in code to suggest matrix D is the coefficient matrix of equation (14.8))
- Add comments in this function and give titles to subplots.
- Change subtitle "Forcast error" ->  "Forcast error and model computation"
- Change the time notations for equations in the section "Experiment 1"
Copy link

netlify bot commented Mar 14, 2024

Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit d2b251b
🔍 Latest deploy log https://app.netlify.com/sites/taupe-gaufre-c4e660/deploys/66010d13d9c2b70008ddddbc
😎 Deploy Preview https://deploy-preview-400--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 configuration.

Copy link

github-actions bot commented Mar 14, 2024

@github-actions github-actions bot temporarily deployed to pull request March 14, 2024 08:38 Inactive
@longye-tian
Copy link
Collaborator Author

Dear John (@jstac),

I have made an update to the coding suggestion in issue #392, incorporating the improvements we discussed.

At your convenience, would you please review the changes?

Best regards ❤️
Longye

@@ -16,13 +16,13 @@ kernelspec:
## Introduction


This lecture is a sequel or prequel to another lecture {doc}`monetarist theory of price levels <cagan_ree>`.
This lecture is a sequel or prequel to another lecture {doc}`A monetarist theory of price levels <cagan_ree>`.
Copy link
Contributor

@jstac jstac Mar 20, 2024

Choose a reason for hiding this comment

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

@longye-tian , would you mind to change this to "...prequel to {doc}`cagan_ree`." That way the title of the lecture will appear naturally, and it's not necessary to repeat it here (CC @HumphreyYang @mmcky). That approach is more robust, since it will update automatically if the title changes.

There are several similar instances below.


Like the model in this lecture {doc}`monetarist theory of price levels <cagan_ree>`, the model asserts that when a government persistently spends more than it collects in taxes and prints money to finance the shortfall, it puts upward pressure on the price level and generates persistent inflation.
Like the model in this lecture {doc}`A monetarist theory of price levels <cagan_ree>`, the model asserts that when a government persistently spends more than it collects in taxes and prints money to finance the shortfall, it puts upward pressure on the price level and generates persistent inflation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Like the model in {doc}`cagan_ree`, ...


Instead of the "perfect foresight" or "rational expectations" version of the model in this lecture {doc}`monetarist theory of price levels <cagan_ree>`, our model in the present lecture is an "adaptive expectations" version of a model that Philip Cagan {cite}`Cagan` used to study the monetary dynamics of hyperinflations.
Instead of the "perfect foresight" or "rational expectations" version of the model in this lecture {doc}`A monetarist theory of price levels <cagan_ree>`, our model in the present lecture is an "adaptive expectations" version of a model that Philip Cagan {cite}`Cagan` used to study the monetary dynamics of hyperinflations.
Copy link
Contributor

Choose a reason for hiding this comment

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

...model in {doc}`cagan_ree`, our...

@@ -278,7 +278,7 @@ $$ (eq:notre)
This outcome is typical in models in which adaptive expectations hypothesis like equation {eq}`eq:adaptexpn` appear as a
component.

In this lecture {doc}`monetarist theory of the price level <cagan_ree>`, we studied a version of the model that replaces hypothesis {eq}`eq:adaptexpn` with
In this lecture {doc}`A monetarist theory of the price level <cagan_ree>`, we studied a version of the model that replaces hypothesis {eq}`eq:adaptexpn` with
Copy link
Contributor

Choose a reason for hiding this comment

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

In {doc}`cagan_ree`,


# solve and plot
π_seq_1, Eπ_seq_1, m_seq_1, p_seq_1 = solve_and_plot(md, μ_seq_1)
```

We invite the reader to compare outcomes with those under rational expectations studied in another lecture {doc}`monetarist theory of price levels <cagan_ree>`.
We invite the reader to compare outcomes with those under rational expectations studied in another lecture {doc}`A monetarist theory of price levels <cagan_ree>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

...studied in {doc}`cagan_ree`.

@jstac
Copy link
Contributor

jstac commented Mar 20, 2024

Many thanks @longye-tian ! I added some small additional requests. Would you mind to make these improvements as well?

This pull request updates the title reference.
@longye-tian
Copy link
Collaborator Author

Dear John ( @jstac ),

I have updated the title to the more robust version.

Best ❤️
Longye

@@ -16,13 +16,13 @@ kernelspec:
## Introduction


This lecture is a sequel or prequel to another lecture {doc}`monetarist theory of price levels <cagan_ree>`.
This lecture is a sequel or prequel to another lecture {doc}`cagan_ree`.
Copy link
Contributor

Choose a reason for hiding this comment

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

cut "another lecture"


Like the model in this lecture {doc}`monetarist theory of price levels <cagan_ree>`, the model asserts that when a government persistently spends more than it collects in taxes and prints money to finance the shortfall, it puts upward pressure on the price level and generates persistent inflation.
Like the model in this lecture {doc}`cagan_ree`, the model asserts that when a government persistently spends more than it collects in taxes and prints money to finance the shortfall, it puts upward pressure on the price level and generates persistent inflation.
Copy link
Contributor

Choose a reason for hiding this comment

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

cut "this lecture"


Instead of the "perfect foresight" or "rational expectations" version of the model in this lecture {doc}`monetarist theory of price levels <cagan_ree>`, our model in the present lecture is an "adaptive expectations" version of a model that Philip Cagan {cite}`Cagan` used to study the monetary dynamics of hyperinflations.
Instead of the "perfect foresight" or "rational expectations" version of the model in this lecture {doc}`cagan_ree`, our model in the present lecture is an "adaptive expectations" version of a model that Philip Cagan {cite}`Cagan` used to study the monetary dynamics of hyperinflations.
Copy link
Contributor

Choose a reason for hiding this comment

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

cut "this lecture"

@@ -36,7 +36,7 @@ It combines these components:

Our model stays quite close to Cagan's original specification.

As in the {doc}`present values <pv>` and {doc}`consumption smoothing<cons_smooth>` lectures, the only linear algebra operations that we'll be using are matrix multiplication and matrix inversion.
As in the {doc}`pv` and {doc}`cons_smooth` lectures, the only linear algebra operations that we'll be using are matrix multiplication and matrix inversion.
Copy link
Contributor

Choose a reason for hiding this comment

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

cut "the" and "lectures" in the first part of the sentence.

@@ -278,7 +278,7 @@ $$ (eq:notre)
This outcome is typical in models in which adaptive expectations hypothesis like equation {eq}`eq:adaptexpn` appear as a
component.

In this lecture {doc}`monetarist theory of the price level <cagan_ree>`, we studied a version of the model that replaces hypothesis {eq}`eq:adaptexpn` with
In this lecture {doc}`cagan_ree`, we studied a version of the model that replaces hypothesis {eq}`eq:adaptexpn` with
Copy link
Contributor

Choose a reason for hiding this comment

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

cut "this lecture"

\mu_0 , & t = 0, \ldots, T_1 -1 \\
\mu^* , & t \geq T_1
\end{cases}
$$

Notice that we studied exactly this experiment in a rational expectations version of the model in this lecture {doc}`monetarist theory of the price level <cagan_ree>`.
Notice that we studied exactly this experiment in a rational expectations version of the model in this lecture {doc}`cagan_ree`.
Copy link
Contributor

Choose a reason for hiding this comment

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

cut "this lecture"


# solve and plot
π_seq_1, Eπ_seq_1, m_seq_1, p_seq_1 = solve_and_plot(md, μ_seq_1)
```

We invite the reader to compare outcomes with those under rational expectations studied in another lecture {doc}`monetarist theory of price levels <cagan_ree>`.
We invite the reader to compare outcomes with those under rational expectations studied in another lecture {doc}`cagan_ree`.
Copy link
Contributor

Choose a reason for hiding this comment

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

cut "another lecture"

@jstac
Copy link
Contributor

jstac commented Mar 21, 2024

Many thanks @longye-tian . Much appreciated. @mmcky will finish this off.

@mmcky can you please make the final changes I requested, fix the conflicts and merge this? No rush.

@mmcky
Copy link
Contributor

mmcky commented Mar 25, 2024

thanks @jstac the changes you suggest have been incorporated and the merge conflict resolved.

@longye-tian can you do a final check to make sure the merge conflict was resolved as you would expect. Please ping me once you have reviewed the diff.

@github-actions github-actions bot temporarily deployed to pull request March 25, 2024 05:43 Inactive
@mmcky mmcky added the ready label Mar 25, 2024
@mmcky mmcky requested a review from jstac March 25, 2024 06:25
@jstac
Copy link
Contributor

jstac commented Mar 25, 2024

Many thanks @longye-tian , and thanks @mmcky for the review. Merging.

@jstac jstac merged commit c33b392 into main Mar 25, 2024
6 checks passed
@jstac jstac deleted the update_cagan_adaptive_code branch March 25, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants