Summary
Currently NonParametric() accepts either a numeric PMF (fixed) or a Dirichlet() prior (estimated, via the gamma‑normalisation trick on the simplex). It would be worth thinking about whether the prior input should be generalised so that other distributions over a simplex can be plugged in.
Motivation
The Dirichlet works well as a default — one concentration knob, easy structural‑zero handling, simple ragged Stan implementation. But for some use cases other priors would be more appropriate:
- Smoothness across bins: neighbouring delay bins are usually similar in mass. A random walk / AR(1) on the log‑PMF (i.e. softmax of an MVN with structured covariance) would express that, while a Dirichlet treats bins as exchangeable.
- Correlated uncertainty: if you have prior covariance information (e.g. from a previous fit summarised as posterior draws), a MVN on logits captures it; Dirichlet only has the fixed mildly‑negative covariance implied by α.
- Posterior re‑use: if
get_parameters(fit) ends up returning a posterior summary as a dist_spec, having more than one option keeps the round‑trip honest when the moment‑matched Dirichlet would be a poor fit.
Concretely, future options to consider:
- A
LogitNormal() / SoftmaxMVN() dist_spec that NonParametric(pmf = ...) could accept.
- A dedicated
SmoothNonParametric() / RWPmf() constructor with a smoothing prior on the log‑PMF (probably the more user‑friendly framing).
Out of scope
Not blocking the current Dirichlet PR (#1338). This is a design question for after that lands.
This was opened by a bot. Please ping @seabbs for any questions.
Summary
Currently
NonParametric()accepts either a numeric PMF (fixed) or aDirichlet()prior (estimated, via the gamma‑normalisation trick on the simplex). It would be worth thinking about whether the prior input should be generalised so that other distributions over a simplex can be plugged in.Motivation
The Dirichlet works well as a default — one concentration knob, easy structural‑zero handling, simple ragged Stan implementation. But for some use cases other priors would be more appropriate:
get_parameters(fit)ends up returning a posterior summary as adist_spec, having more than one option keeps the round‑trip honest when the moment‑matched Dirichlet would be a poor fit.Concretely, future options to consider:
LogitNormal()/SoftmaxMVN()dist_specthatNonParametric(pmf = ...)could accept.SmoothNonParametric()/RWPmf()constructor with a smoothing prior on the log‑PMF (probably the more user‑friendly framing).Out of scope
Not blocking the current Dirichlet PR (#1338). This is a design question for after that lands.
This was opened by a bot. Please ping @seabbs for any questions.