Skip to content

ExponentialClassFamily: posterior predictive distribution #51

@LeonidElkin

Description

@LeonidElkin

ExponentialClassFamily: posterior predictive distribution

Task

Add generic support for computing posterior predictive distributions for ExponentialClassFamily using only A, T, h and the sample.

Requirements

1. Method signature

Add a method:

  • posterior_predictive(prior_hyperparameters, sample),

which:

  • takes:
    • prior hyperparameters (same representation as in posterior_hyperparameters),
    • a sample of observations from the model,
  • returns:
    • an object representing the posterior predictive distribution.

The return type should be consistent with the rest of the library, e.g.:

  • another ParametricFamily,
  • or a small “predictive” wrapper that implements at least pdf/pmf, cdf, sampling, etc.

2. Use only exponential-family structure

The implementation must rely only on:

  • the exponential-family representation:
    • A(θ), T(x), h(x),
  • and the updated posterior hyperparameters (from posterior_hyperparameters).

In other words, posterior_predictive should not require hard-coded formulas for specific distributions; instead, it should:

  • use generic relationships between the model and its conjugate prior in exponential families.

3. Conceptual behaviour

Conceptually, for an exponential family with conjugate prior:

  • the posterior predictive density is:
    • p(x_new | sample, prior) = ∫ f(x_new | θ) * p(θ | sample, prior) dθ.

posterior_predictive must encode this object in the library’s abstractions, not necessarily evaluate the integral symbolically.

Implementation-wise, you can:

  • reuse the same parametrization as the original family, but with hyperparameters “integrated out”,
  • or define a dedicated predictive-family wrapper that knows how to evaluate predictive pdf/pmf at a given point using A, T, h and hyperparameters.

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions