A noise formula that uses a fixed model parameter (PEtab noiseFormula `0.5 * v3`) passes every load check, then fails each parameter set as it is scored, so the fit either stops with "Your simulations are failing to run" or finishes with an objective of inf

Open
#961 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
54/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Trace the importer and scoring paths in pybnf/petab/import_.py:954-956, pybnf/config.py:2560 and 2616, pybnf/noise/source.py:616-626, and pybnf/algorithms/core.py:407-414. Reproduce the supplied PEtab example, then determine whether model parameters in noise formulas should be resolved like measurement formulas or rejected during loading. Done means the example reports the real configuration error or computes the expected objective, rather than recording every evaluation as a failed simulation with inf.

Written by the indexing model from the issue text.

Description

bug silent-incorrectness

A PEtab problem whose noiseFormula uses a model parameter that is not estimated, such as 0.5 * v3 with v3 = 3 in the model, imports as noise_model y = gaussian, sigma = prediction_formula 0.5 * v3 and passes every check when the job loads. Every parameter set then fails as it is scored, because PyBNF looks for v3 among the simulated columns. PyBNF counts each of these as a failed simulation, and the real cause goes only to the log file. With the importer's default settings, the fit stops after 100 of them with "Your simulations are failing to run. Logs from failed simulations are saved in the FailedSimLogs directory", although no simulation failed and FailedSimLogs is empty. A run with fewer than 100 evaluations prints only "Fitting complete", exits 0, and reports a random draw as the best fit, with an objective of inf for every parameter set. The correct noise SD is 0.5 × 3 = 1.5, which gives an objective of 0.1667 at the problem's start point.

Example

Model m.bngl: y()=v1*(x^2)+(v2*x)+v3 over a counter x that grows at rate 1 from 0, with v1 0.5, v2 1, v3 3.

PEtab tables (libpetab v2 lint: no issues):

parameters.tsv    parameterId  lowerBound  upperBound  nominalValue  estimate
                  v1           0           10          0.5           true
                  v2           0           10          1             true
observables.tsv   observableId  observableFormula  noiseFormula  noiseDistribution
                  obs_y         y                  0.5 * v3      normal
measurements.tsv  obs_y  e1  time 0, 1, 2  measurement 3.5, 4, 7.5
experiments.tsv   e1  0  (no condition)
from pybnf.petab import import_job
import_job('problem.yaml', 'imp')          # writes imp/imported.conf

Then pybnf -c imported.conf, run in imp/:

  • With the importer's default settings (population_size = 50): Error: Your simulations are failing to run. Logs from failed simulations are saved in the FailedSimLogs directory. FailedSimLogs is empty.
  • With population_size = 3, max_iterations = 1: the console shows Fitting complete, the exit code is 0, and sorted_params_final.txt lists three parameter sets, each with Obj inf. The first one listed is a random draw (v1 = 4.70, v2 = 7.37).
  • The log file has one line per evaluation: A prediction-dependent noise formula for 'y' references 'v3', which is neither a declared free parameter nor a simulated output column.

Correct value: the same job with sigma = fix_at 1.5 scores the start point (0.5, 1) at 0.16667, and numpy gives Σ(y − d)²/(2·1.5²) = 0.75/4.5 = 0.16667.

The same thing happens to other errors in the conf that PyBNF finds only while scoring. For example, a constraint file that uses par.x.par (constraint.py:469) gives "Your simulations are failing to run" with an empty FailedSimLogs, or "Fitting complete" with inf in a short run.

Why

At load, the prediction_formula is checked against the model's names, which include its parameters, so v3 passes (pybnf/config.py:2616). When each parameter set is scored, the noise source looks up every name that is not a free parameter as a simulated column and raises when it is not there (pybnf/noise/source.py:616-626). Measurement formulas (observable: ..., formula:) avoid this by reading model parameters from a constants table (config.py:2560); the noise formula has no such table. The scoring step catches every exception and records it as a failed simulation (pybnf/algorithms/core.py:407-414, from #388). The importer chooses prediction_formula because v3 is a model name (pybnf/petab/import_.py:954-956).

Possible fix

Give the noise formula the same treatment of model parameters as measurement formulas, or refuse at load and name the parameter. Separately, an error in the conf that is raised while scoring should end the run with its own message, not be counted as a failed simulation.

Related: #817 (the same scoring-step catch), #836 (measurement formulas that read a parameter changed by a condition).

Found while fixing the PEtab issues #892–#908 (2026-09-25); reproduced on main at cd2be675.

Dominant language
Python
Stars
25
Forks
25
Avg merge
4h 5m
Merged PRs (30d)
10

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lanl/PyBNF

All issues in lanl/PyBNF

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.