Skip to content

[harrison_creps] Use linear solver instead of matrix inverse#669

Open
UdohNakamura wants to merge 1 commit into
QuantEcon:mainfrom
UdohNakamura:main
Open

[harrison_creps] Use linear solver instead of matrix inverse#669
UdohNakamura wants to merge 1 commit into
QuantEcon:mainfrom
UdohNakamura:main

Conversation

@UdohNakamura

Copy link
Copy Markdown
Contributor

This patch replaces the explicit inverse computation la.inv(I - βQ) with la.solve(I - βQ, βQd) in price_single_beliefs for better numerical stability and efficiency.

The output remains identical to the previous implementation.

Refactor price_single_beliefs function to improve clarity and efficiency.
@UdohNakamura

Copy link
Copy Markdown
Contributor Author

I also found that np.linalg.solve works the same here, so removing scipy might be possible.
However, I'm not confident about this, so I’d like to leave the decision to the reviewers.

@jstac

jstac commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

Many thanks @UdohNakamura !

@mmcky This looks good to me. Please check if we can remove scipy.

@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 (UdohNakamura), 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 — 161 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 161 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: harrison_kreps.md. Last CI build: n/a (fork). Branch: 161 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.

2 participants