Feature request: semiparametric (monotone-spline) link for qualitative/ordinal data — learn the measurement-model shape instead of fixing probit/logit
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 15/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- bioinformatics
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 25
- Forks
- 25
- Merge medio
- 4 h 5 min
- PR fusionados (30 d)
- 10
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de lanl/PyBNF
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug tech debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
bug silent-incorrectness
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
Todos los issues de lanl/PyBNF
Issues similares
-
Quick Installation step 2 installs from the plugin manager, but the plugin isn't published yetAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
Los mantenedores suelen responder en 6 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
gh-sync ship audits cards before writing station done, so every ship reports false STATUS findingsAbiertoharness
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mruangutai/harness#2455 ·
Los mantenedores suelen responder en 1 día
-
stripthink leaves thinking text in place when the chat template opens the think tag in the promptPosiblemente ocupada @MaiAditya la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
xcorr sizes its bin array from the largest observed m/z, so one out-of-range peak kills the runPosiblemente ocupada @BioGeek la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
instadeepai/winnow#312 ·