Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] probability distributions - boilerplate refactor #265

Merged
merged 69 commits into from
Apr 23, 2024
Merged

Conversation

fkiraly
Copy link
Collaborator

@fkiraly fkiraly commented Apr 21, 2024

Towards #251.

This PR refactors the probability distributions, inheriting from BaseDistribution:

  • adds a boilerplate layer dealing with input coercion, formatting, indices
  • extension points move from public to private under boilerplate, e.g., to _pdf from pdf
  • distributions are now polymorphic - if all parameters are scalar, and no index is given, behaves as a scalar. Otherwise behaves as a 2D array distribution, as before.

Also refactors all distributions with "non-complex" signature, and also with exception of QPD (which is subject to multiple other PRs)

@fkiraly fkiraly added enhancement module:probability&simulation probability distributions and simulators labels Apr 21, 2024
@fkiraly
Copy link
Collaborator Author

fkiraly commented Apr 21, 2024

Note to self: refactor is downwards compatible, but default broadcasting cannot deal with the empirical distribution, where parameters are multi-indexed DataFrame.

@fkiraly fkiraly marked this pull request as ready for review April 23, 2024 19:06
@fkiraly fkiraly merged commit af1ce8e into main Apr 23, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement module:probability&simulation probability distributions and simulators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC] extension template for probability distributions
1 participant