Skip to content

Conversation

@xImoZA
Copy link

@xImoZA xImoZA commented Nov 27, 2025

This PR introduces the Method of Moments estimation strategy, providing a generalized and analytical implementation for the Exponential distribution.

Changes

  • Generalized Strategy: Implemented the base moments_strategy, which allows for extensible implementations and raises a NotImplementedError for any distribution that does not have a registered strategy.

Exponential Implementation:

Added the analytical solution for Exponential distribution parameters (loc and rate) based on weighted empirical moments. The implementation handles various parameter configurations:

  • Fixed loc -> Updates rate based on the first moment.
  • Fixed rate -> Updates loc based on the first moment.
  • Non-fixed parameters -> Updates both using variance and mean.

Testing: Added comprehensive unit tests covering:

  • Base dispatcher behavior using a DummyDistribution.
  • Parameter recovery for all fixing combinations.
  • Numerical stability checks and overflow handling.

@xImoZA xImoZA requested a review from iraedeus November 27, 2025 15:26
@xImoZA xImoZA linked an issue Nov 27, 2025 that may be closed by this pull request
5 tasks
@xImoZA xImoZA self-assigned this Nov 27, 2025
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.

FEAT: Add moments strategy for Exponential

2 participants