Skip to content

[ak_aiyagari] Fix inconsistent household reference (hhhousehold)#706

Open
sudayuga wants to merge 2 commits into
QuantEcon:mainfrom
sudayuga:ak_aiyagari_patch
Open

[ak_aiyagari] Fix inconsistent household reference (hhhousehold)#706
sudayuga wants to merge 2 commits into
QuantEcon:mainfrom
sudayuga:ak_aiyagari_patch

Conversation

@sudayuga

Copy link
Copy Markdown

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

jstac commented Nov 16, 2025

Copy link
Copy Markdown
Contributor

many thanks @sudayuga !

@HumphreyYang , could you please review?

@HumphreyYang

HumphreyYang commented Nov 17, 2025

Copy link
Copy Markdown
Member

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!

@jstac

jstac commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🤖 Status note for a future session — from a maintainer investigation on 2026-07-08 into why open-PR previews 404. Context only, not instructions.

Netlify preview: none — and there never was one. This PR is from a fork (sudayuga), and fork PRs don't receive the repo's NETLIFY_AUTH_TOKEN, so the preview job can't deploy. To get a preview, a maintainer can push this branch to the main repo as an internal PR, or build locally.

Why previews are down (repo-wide findings)

1. This branch is stale — 126 commits behind main. A preview build compiles the whole site from this branch. This branch's lectures/house_auction.md still has unpinned !pip install prettytable, which now breaks on a wcwidth incompatibility. main fixed this on 2026-06-28 by pinning prettytable<3.18 (#939). This alone fails any rebuild of this branch until it's updated to main.

2. The arviz failure was a red herring — do NOT pin arviz or rewrite plotting. A 2026-07-07 rebuild also failed in ar1_bayes/ar1_turningpts with an arviz_plots figsize ValueError. That was a transient bug in an intermediate arviz-plots 1.x release, already fixed in arviz 1.2.0. Verified locally on a clean latest-stack venv: the real az.plot_trace(trace) cell (pymc + numpyro InferenceData) runs green. The lectures use only 1.x-compatible arviz APIs (plot_trace, summary, from_numpyro, compare).

Recommended first step for this PR

Update the fork branch to main (it's 126 commits behind) to clear the house_auction breakage, then review. A live preview requires re-hosting the branch in the main repo (fork limitation above).


This PR touches: ak_aiyagari.md. Last CI build: n/a (fork). Branch: 126 commits behind main as of 2026-07-08.

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