PEtab v2 cannot carry a negative-binomial noise model or the cumulative-to-incident transform: encode the transform with per-period conditions, and add negative-binomial noise as a versioned PyBNF extension
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start in pybnf/petab/export.py by reading _resolve_noise and _reject_cumulative, then inspect the existing PEtab import and round-trip tests. The proposal has separate cumulative-transform and count-noise paths, with open decisions around PEtab periods, parameter mappings, and negative-binomial parameterisation. Done requires agreed behavior, supported and refused cases, and round-trip coverage.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
A job whose data are counts, scored as the increments of a cumulative model output under a negative-binomial noise model, cannot be exported to PEtab v2 or imported from it. pybnf/petab/export.py refuses both parts:
_resolve_noiserefusesneg_bin*, because PEtab v2 has no negative-binomial noise distribution;_reject_cumulativerefuses thecumulativeprediction transform (ADR-0051, #418), because PEtab v2 has no row-coupled cumulative-to-incident operator.
Both refusals are correct today, since nothing is dropped silently. This issue proposes how to lift them. One part can be done inside the PEtab v2 core. The other needs an extension, and eventually a spec change.
What PEtab v2 allows (v2.0.0, released 2026-09-08; libpetab-python 0.9.0)
noiseDistributionis one ofnormal,log-normal,laplaceorlog-laplace. For every distribution the simulated value is the median. There is no Poisson or negative-binomial distribution in v2.0.0.- Upstream, the request
PEtab-dev/PEtab#653has an approved but unmerged PR,PEtab-dev/PEtab#654("Add discrete noise distributions", open since 2025-12-02). It addspoisson,binomialandnegative-binomial.- Its negative binomial is π(m | r, p) = C(m+r−1, m)·p^r·(1−p)^m, with r given by
observableFormulaand the success probability p given bynoiseFormula. It is not parameterised by a mean and a dispersion. - A mean-μ, dispersion-r negative binomial would be written
observableFormula = r,noiseFormula = r/(r + μ), with μ the model's predicted increment. The "simulated value" is then r, not the mean or the median.
- Its negative binomial is π(m | r, p) = C(m+r−1, m)·p^r·(1−p)^m, with r given by
observableFormulais evaluated at a single time point. There is no lag operator, so C(t_k) − C(t_{k−1}) cannot be written as an observable.- The experiment table allows an arbitrary number of periods per experiment. The condition active at a period's start may target a model state or parameter.
targetValueexpressions are evaluated with the values at the end of the preceding period.- All targets of a condition are assigned simultaneously.
- Observables at that time are evaluated after the assignments.
noiseFormulamay reference estimated parameters, so a dispersion r can be estimated.- A problem may declare
extensionsinproblem.yaml. A tool that does not support an extension markedrequired: truemust reject the problem. The importer ignoring this today is #957.
Proposal
A. Encode cumulative-to-incident inside PEtab v2 core (no extension)
Give each observation time t_k its own experiment period. The condition active at t_k sets two model parameters:
W := C − C_prev;C_prev := C.
Here C is the cumulative model quantity. Because target values are computed from the end of the preceding period, and observables are evaluated after the assignment, an observable equal to W at t_k is exactly the increment over the interval between measurements. That is the per-interval meaning ADR-0051 intends (see #819).
- Export writes this encoding for an observable flagged
cumulative. - Import recognises the pattern and restores the
cumulativeflag, so the problem round-trips.
Points to settle before implementing:
- C must be referenceable in a
targetValue. For a BNGL model that likely means a model state, such as a seed species that accumulates the counted events, referenced through a mapping-table alias. Check thatpetablintaccepts this. WandC_prevare model parameters that are not estimated. Confirm how they appear, or don't, in the parameter table.- The importer's period handling has open bugs that this encoding would hit: #951 (a measured period that starts at a time other than 0) and #954 (a blank time read as 0). Those should be fixed first.
- It is unverified whether other PEtab v2 tools, such as AMICI or PEtab.jl, simulate many state-setting periods correctly. A round-trip test inside PyBNF is the minimum check.
B. A versioned PyBNF PEtab extension for count noise
Until PEtab-dev/PEtab#654 is merged and released, define an extension, for example pybnf_count_noise v0.1. PyBNF declares it with required: true on export and supports it on import.
The extension should adopt that PR's tokens and parameterisations exactly: negative-binomial with r from observableFormula and p from noiseFormula, and poisson with the rate from observableFormula. Then, if the PR lands unchanged, the extension becomes core with no change to exported problems.
What needs deciding:
- Mapping PyBNF's negative binomial. PyBNF's negative binomial is parameterised by a prediction μ and a dispersion r, centred at the mean or at the median (ADR-0011, ADR-0031, #419, #424).
- The mean-centred form maps exactly:
observableFormula = r,noiseFormula = r/(r + μ). - The median-centred form defines μ implicitly through the CDF, and probably has no closed-form (r, p). Export should refuse it by name, as it does today for other unrepresentable settings (#898).
- The mean-centred form maps exactly:
- Estimated dispersion. r may be an estimated parameter. With that layout it sits in
observableFormulaand μ sits innoiseFormula. Check that PyBNF's observable and noise layers, and the gradient path, accept that arrangement. - Round trip. Export/import round-trip tests for every negative-binomial form PyBNF can export, plus a refusal test for the forms it cannot.
C. Upstream (human review only)
PEtab-dev/PEtab#654 is the natural place for feedback from PyBNF's side. Examples: whether a mean-and-dispersion negative binomial should be expressible directly, and how the core's "simulated value is the median" sentence applies to the discrete distributions. Nothing should be posted to the PEtab-dev repositories from automation. Any comment or proposal there must be drafted and reviewed by a person before it is submitted.
Relation to #973
The ibis sampler proposed in #973 is a run setting (job_type), not part of the estimation problem, so it needs nothing from PEtab. Once A and B land, a PEtab-imported count problem can be run with job_type = ibis like any other job type. Successive data vintages are successive measurement tables.
- Ngôn ngữ chính
- Python
- Star
- 25
- Fork
- 25
- Merge trung bình
- 4 giờ 5 phút
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của lanl/PyBNF
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug tech debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug silent-incorrectness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
gh-sync ship audits cards before writing station done, so every ship reports false STATUS findingsĐang mởharness
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mruangutai/harness#2455 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
stripthink leaves thinking text in place when the chat template opens the think tag in the promptCó thể đã có người làm @MaiAditya đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
xcorr sizes its bin array from the largest observed m/z, so one out-of-range peak kills the runCó thể đã có người làm @BioGeek đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
instadeepai/winnow#312 ·