Summary
The location axis (ADR-0011 / ADR-0024) lets the model prediction be interpreted as a chosen summary of the noise distribution -- mean or median. PyBNF should offer both for every noise model / likelihood, with median the default. (Median aligns with PEtab v2's convention, but this is a PyBNF capability decision -- PyBNF deliberately supports more than the PEtab v2 subset.)
Current state
- Gaussian (
normal / lognormal): both supported. On a linear scale mean = median (coincide); on a log scale median is the default (offset 0) and mean adds the Gaussian moment correction mu = log(pred) - ln(base)*sigma**2/2 (noise/scale.py::mean_offset).
- Per-observable selection via the
location = mean|median field on the noise_model line (ADR-0024). A global noise_location default is planned.
Gaps to close
-
neg_bin median. neg_bin is parameterized directly by its mean (the prediction is the mean), so location = mean is the current (only) interpretation; location = median raises "not implemented" today (objective._apply_location). The negative-binomial median has no closed form, so centering the prediction on it needs a numeric CDF inversion (place prediction at the median by solving nbinom.cdf(median; r, p) = 0.5). Implement so location = median works for neg_bin.
-
log-laplace mean. Laplace's moment correction on a log scale differs from Gaussian's: the mean of a (natural-log) log-Laplace is e^m / (1 - b**2) (for |b| < 1), not e^(m + sigma**2/2). scale.mean_offset currently implements only the Gaussian correction (noted in ADR-0011 / ADR-0024), so location = mean on a log-scale Laplace would be numerically wrong today. Give the Laplace family its own moment correction (make the offset family-aware).
Default
Median across the board (the ADR-0024 default). neg_bin's existing default is mean; once median is implemented, decide whether to flip neg_bin's default to median (a behavior change) or keep mean as its default with median opt-in (backward-compat consideration).
Acceptance
Every (noise family x additive scale) supports both mean and median centering, correctly, validated against scipy oracles (nbinom, laplace, lognorm). Relates to ADR-0011, ADR-0021, ADR-0024.
Summary
The location axis (ADR-0011 / ADR-0024) lets the model prediction be interpreted as a chosen summary of the noise distribution --
meanormedian. PyBNF should offer both for every noise model / likelihood, with median the default. (Median aligns with PEtab v2's convention, but this is a PyBNF capability decision -- PyBNF deliberately supports more than the PEtab v2 subset.)Current state
normal/lognormal): both supported. On a linear scale mean = median (coincide); on a log scale median is the default (offset 0) andmeanadds the Gaussian moment correctionmu = log(pred) - ln(base)*sigma**2/2(noise/scale.py::mean_offset).location = mean|medianfield on thenoise_modelline (ADR-0024). A globalnoise_locationdefault is planned.Gaps to close
neg_binmedian.neg_binis parameterized directly by its mean (the prediction is the mean), solocation = meanis the current (only) interpretation;location = medianraises "not implemented" today (objective._apply_location). The negative-binomial median has no closed form, so centering the prediction on it needs a numeric CDF inversion (placepredictionat the median by solvingnbinom.cdf(median; r, p) = 0.5). Implement solocation = medianworks forneg_bin.log-laplacemean. Laplace's moment correction on a log scale differs from Gaussian's: the mean of a (natural-log) log-Laplace ise^m / (1 - b**2)(for|b| < 1), note^(m + sigma**2/2).scale.mean_offsetcurrently implements only the Gaussian correction (noted in ADR-0011 / ADR-0024), solocation = meanon a log-scale Laplace would be numerically wrong today. Give the Laplace family its own moment correction (make the offset family-aware).Default
Median across the board (the ADR-0024 default).
neg_bin's existing default is mean; once median is implemented, decide whether to flipneg_bin's default to median (a behavior change) or keep mean as its default with median opt-in (backward-compat consideration).Acceptance
Every (noise family x additive scale) supports both
meanandmediancentering, correctly, validated against scipy oracles (nbinom,laplace,lognorm). Relates to ADR-0011, ADR-0021, ADR-0024.