Feature request: semiparametric (monotone-spline) link for qualitative/ordinal data — learn the measurement-model shape instead of fixing probit/logit

Aperta
#979 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

  1. Robustness. Biophysical parameters stop absorbing the link's misspecification.
  2. A measurement model worth reading. The fitted m is itself informative about the assay (saturation, bin nonlinearity, drift).
  3. Parity with MAVE-NN on the data type where that comparison will be made, within a general rule-based framework.
  4. 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.
Lingua principale
Python
Stelle
25
Fork
25
Merge medio
4h 5m
PR unite (30g)
10

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lanl/PyBNF

Tutte le issue di lanl/PyBNF

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.