Skip to content

[ENH] probability distributions - boilerplate refactor#265

Merged
fkiraly merged 69 commits into
mainfrom
bc-enhanced
Apr 23, 2024
Merged

[ENH] probability distributions - boilerplate refactor#265
fkiraly merged 69 commits into
mainfrom
bc-enhanced

Conversation

@fkiraly

@fkiraly fkiraly commented Apr 21, 2024

Copy link
Copy Markdown
Collaborator

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

fkiraly commented Apr 21, 2024

Copy link
Copy Markdown
Collaborator Author

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