-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Refactor existing families using ExponentialClassFamily
Task
Refactor existing distribution families so that their exponential-family structure is explicitly represented via ExponentialClassFamily.
The goal is not to introduce new distributions, but to re-implement the already existing ones:
NormalContinuousUniformExponential
using the ExponentialClassFamily abstraction, ensuring full consistency with their current behavior.
Requirements
1. Re-implementation via ExponentialClassFamily
For each of the following families:
- Normal distribution
- ContinuousUniform distribution
- Exponential distribution
you must:
- identify and explicitly define the exponential-family components:
- sufficient statistic
T(x), - base measure
h(x), - log-partition function
A(θ), - natural parameter
θ, - parameter space constraints;
- sufficient statistic
- construct a corresponding
ExponentialClassFamilyinstance; - integrate it into the existing registry in place of (or alongside, if transitional) the current implementation.
The external behavior of the family must remain unchanged.
2. Behavioral consistency
Ensure that:
- The
pdf/pmfcomputed through the exponential-family representation matches the current implementation numerically (within tolerance). - All characteristics reachable from the family (e.g.
mean,var, etc.) behave identically to the previous version. - Array semantics and broadcasting behavior remain consistent.
If both implementations temporarily coexist, add tests verifying equivalence.
3. Conjugacy and posterior behavior (where applicable)
For families where conjugate priors are defined:
- Verify that conjugate prior logic still works correctly.
- Ensure
posterior_hyperparametersbehaves as expected (e.g. Normal–Normal, Exponential–Gamma, if applicable). - Add regression tests if necessary.
4. Documentation & example notebook
Create a Jupyter notebook demonstrating:
- How
Normal,ContinuousUniform, andExponentialare represented as exponential families via docstrings, - The decomposition into
T(x),h(x),A(θ), - Verification that densities match the original definitions.
Place the notebook under:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status