[harrison_kreps]: Fix axis#645
Conversation
UdohNakamura
commented
Oct 13, 2025
- Problem: np.max(..., axis=1) / np.min(..., axis=1) compares across states, not across investor types.
- Spec: Per equations (78.3) and (78.5), the max/min must be taken across types → axis=0.
- Fix: Replace axis=1 with axis=0 in the three lines below.
Fixed axes
|
Many thanks @UdohNakamura! This looks great to me. Hi @mmcky, this is a small (but important) fix. Should we merge it when you are ready? @UdohNakamura's change does not affect output because the two agent case is pretty special (with the same off diagnoal entries being the smallest ones). If we add a three-state two-agent exercise then it will cause issue. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the axis parameter in numpy max/min operations within the Harrison-Kreps model implementation. The issue was that the code was taking max/min across states (axis=1) instead of across investor types (axis=0) as required by the mathematical equations.
Key changes:
- Corrected axis parameter from 1 to 0 in three numpy operations
- Ensures proper computation according to equations (78.3) and (78.5)
- Affects both optimistic and pessimistic belief pricing functions
|
thanks @UdohNakamura -- there seems to be an issue with permissions to @HumphreyYang the logs indicate this is building well so I'll merge now. |