Feature request: semiparametric (monotone-spline) link for qualitative/ordinal data — learn the measurement-model shape instead of fixing probit/logit
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 15/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
Start from the existing fixed-link code behind qualitative_scale (probit/logit/hinge) and the SBML/PEtab observable measurement-model layer the issue names as the likely attachment point; #976 holds the MPRA setup. Reproduce the default probit path and its likelihood/profile-likelihood plumbing first, then add the I-spline link, ordered thresholds, and the qualitative_link/df/knot-placement config keys. Done means the identity-spline case reproduces probit exactly, the fitted monotone m stays differentiable under the existing gradient machinery, and a fixed-vs-flexible profile-likelihood comparison runs end to end.
由索引模型根据 Issue 内容生成。
描述
Summary
For qualitative/ordinal data, PyBNF's likelihood models use a link of fixed shape: the probit (confidence/tolerance), the logit (logit scale), or the hinge. qualitative_scale = fit s lets a fit estimate the link's width, but not its shape.
This is a feature request for a semiparametric link: let the fit learn the shape of the map from a model prediction to category probabilities, using a monotone spline. In statistical terms, the current models are single-index models with a known link; this would allow an unknown link.
Motivation
1. Misspecification of the link biases biophysical parameters, silently.
Concrete case (MPRA-style data, one promoter variant per BNGL function, one BPSL constraint per sequenced cell; see #976 for the setup). Fitting a thermodynamic model to above/below-wild-type calls with the fixed probit gave an apparently well-determined RNAP concentration, with a likelihood-ratio statistic of 24.7 against the weak-binding limit. A synthetic-data check then showed that two plausible departures from the assumed link — noise whose width grows with the predicted value, and the stratified sorting design the real experiment actually used — each manufacture a larger signal (51–114) from data generated with no such parameter at all. The estimate was an artifact of the link, not evidence in the data.
A fit cannot currently distinguish "the data say this" from "my assumed link says this".
2. There is precedent, and theory.
MAVE-NN (Tareen et al., Genome Biology 23:98, 2022) fits the same class of models to the same class of data, and learns the measurement process p(y|φ) from the data: "a multilayer perceptron with one hidden layer (having tanh activations) and a softmax output layer", trained jointly with the genotype-phenotype map by maximizing the likelihood.
More generally this is the semiparametric single-index model with an unknown link (Ichimura; Härdle & Stoker; Horowitz), where the response depends on the covariates only through a scalar index. The relevant known result is that the index is then identified only up to location and scale — MAVE-NN calls these "diffeomorphic modes" and fixes them by convention. That identifiability cost is the honest price of the robustness, and it is the point of item 4 below.
Proposed feature
A monotone-spline link, not a neural network. The index here is scalar, so a 1-D monotone transformation is the natural object and is much better suited than an MLP: few parameters, monotone by construction, interpretable, and differentiable, so it works with the existing gradient and profile-likelihood machinery.
For a predicted value q (the constraint margin, as the probit/logit models already compute it), replace the fixed CDF with a cumulative-link model
P(category <= k | q) = Phi( t_k - m(q) ) k = 1 .. K-1
where m is a monotone spline (an I-spline basis with non-negative coefficients, or a monotone PCHIP through fitted knot heights) and t_k are ordered thresholds. With m the identity this reduces exactly to the present probit, so the existing behaviour is the default and a special case.
Sketch of the configuration surface, parallel to qualitative_scale:
qualitative_link = spline, df = 5 # or: probit (default), logit
qualitative_link_knots = quantile # knot placement over the observed range of q
As with qualitative_scale, one link would be tied across all qualitative constraints, which is the identifiable case.
What this buys, in four parts:
- Robustness. Biophysical parameters stop absorbing the link's misspecification.
- A measurement model worth reading. The fitted
mis itself informative about the assay (saturation, bin nonlinearity, drift). - Parity with MAVE-NN on the data type where that comparison will be made, within a general rule-based framework.
- A robustness diagnostic, which is the most valuable part. Fit twice, once with the fixed link and once with the flexible one, and compare. If the parameter estimates move materially, the assumed link was carrying the result. This pairs directly with
job_type = profile_likelihood, and in the case above it would have caught the artifact immediately.
Caveats, which belong in the documentation
- Identifiability is traded away deliberately. A flexible link absorbs exactly the signal that identifies parameters acting only through a reshaping of the index. Parameters estimable under a fixed link may become unidentifiable. That is a feature when the fixed link is wrong and a real loss when it is right, so both fits are worth reporting.
- It needs enough categories and enough data. With only two categories there is little shape to learn and much to lose; the feature is aimed at ordinal data with several categories, or several conditions.
- Monotonicity should be enforced, not hoped for, or the link and the model will trade places.
Related
- #976 (the setup these data come from), and the measurement-model layer already present for SBML/PEtab observables, which may be the natural place to attach this.
- 主要语言
- Python
- 星标
- 25
- 派生
- 25
- 平均合并
- 4 小时 5 分钟
- 30 天内合并 PR
- 10
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lanl/PyBNF 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug minor
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug tech debt
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug minor
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
bug silent-incorrectness
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
gh-sync ship audits cards before writing station done, so every ship reports false STATUS findings未关闭harness
难度 2/5 1-3 小时 新手友好度 72/100
mruangutai/harness#2455 ·
维护者通常 1 天内回复
-
stripthink leaves thinking text in place when the chat template opens the think tag in the prompt可能已有人在做 @MaiAditya 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
xcorr sizes its bin array from the largest observed m/z, so one out-of-range peak kills the run可能已有人在做 @BioGeek 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
instadeepai/winnow#312 ·