-
-
Notifications
You must be signed in to change notification settings - Fork 50
[aiyagari] MAINT: transfer np.sum(a * b) to a @ b #467
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Aiyagari lecture notebook by synchronizing Jupytext metadata, standardizing code-cell directives, and refactoring the capital‐supply calculation to use the @
operator instead of np.sum
.
- Add
format_version
andjupytext_version
to notebook metadata and adjust kernel display name. - Change all
{code-cell}
directives to useipython3
and the:tags:
syntax. - Introduce
prices_to_capital_stock
and replacenp.sum(a * b)
withasset_probs @ am.a_vals
, retaining the original results for comparison.
Comments suppressed due to low confidence (2)
lectures/aiyagari.md:472
- [nitpick] The parameter name
am
is ambiguous; consider renaming it to something likehousehold
orhh
to clarify that it’s an instance of theHousehold
class.
def prices_to_capital_stock(am, r):
lectures/aiyagari.md:464
- [nitpick] Function name
rd
is not very descriptive; consider renaming it to something likeinterest_rate_from_capital
orcapital_demand_rate
for clarity.
def rd(K):
am_ddp = DiscreteDP(am.R, am.Q, am.β) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable am_ddp
is assigned but never used; it can be removed to reduce clutter.
am_ddp = DiscreteDP(am.R, am.Q, am.β) |
Copilot uses AI. Check for mistakes.
@HumphreyYang this is an easy one, but would you mind reading through #463 (comment) and letting me know if you approve of this change to:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mmcky, this looks great to me.
I think we can go ahead with a global switch, as I don't expect this change to cause much trouble.
After that, we can review all the updated lectures to ensure they’re consistent with the previous results!
This PR fixes part of #463