Skip to content

Conversation

@sudayuga
Copy link

Summary

Several functions incorrectly referenced a global variable hh instead of using the household argument passed to them.
This caused silent inconsistency and potential runtime failure if hh is not defined in the global scope.

Fix

  • Replaced all hh.* references with household.*
  • Ensured dimensional consistency (J, num_state)
  • Updated calls to backwards_opt, popu_dist, compute_aggregates,
    and solve_backwards to use the injected household object

This PR resolves a naming inconsistency and potential bug across several functions where a global variable hh was referenced instead of the household argument passed into the function. This issue affects several key components of the model's implementation, including find_ss, popu_dist, compute_aggregates, and others.
@jstac
Copy link
Contributor

jstac commented Nov 16, 2025

many thanks @sudayuga !

@HumphreyYang , could you please review?

@HumphreyYang
Copy link
Member

HumphreyYang commented Nov 17, 2025

Many thanks @sudayuga, this looks perfect to me!

Hi @mmcky, I think this is ready to merge. I will do some minor cleanups on other parts of the lecture once it is merged!

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.

3 participants