Skip to content

Conversation

UdohNakamura
Copy link
Contributor

  • 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.

@HumphreyYang
Copy link
Member

HumphreyYang commented Oct 15, 2025

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.

@HumphreyYang HumphreyYang requested review from Copilot and mmcky October 15, 2025 06:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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