[aiyagari] MAINT: transfer np.sum(a * b) to a @ b#467
Conversation
There was a problem hiding this comment.
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_versionandjupytext_versionto notebook metadata and adjust kernel display name. - Change all
{code-cell}directives to useipython3and the:tags:syntax. - Introduce
prices_to_capital_stockand 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
amis ambiguous; consider renaming it to something likehouseholdorhhto clarify that it’s an instance of theHouseholdclass.
def prices_to_capital_stock(am, r):
lectures/aiyagari.md:464
- [nitpick] Function name
rdis not very descriptive; consider renaming it to something likeinterest_rate_from_capitalorcapital_demand_ratefor clarity.
def rd(K):
| am_ddp = DiscreteDP(am.R, am.Q, am.β) | ||
|
|
There was a problem hiding this comment.
The variable am_ddp is assigned but never used; it can be removed to reduce clutter.
| am_ddp = DiscreteDP(am.R, am.Q, am.β) |
|
@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:
|
HumphreyYang
left a comment
There was a problem hiding this comment.
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!
|
thanks @HumphreyYang |
|
thanks @HumphreyYang -- we are getting some help from RAs in Japan as well. |
This PR fixes part of #463