PEtab-dev / libpetab-python

Python package for working with PEtab files
https://libpetab-python.readthedocs.io
MIT License
14 stars 6 forks source link

Unclear how to encode noise model: `Mismatch of noise parameter overrides` #148

Closed matthiaskoenig closed 2 years ago

matthiaskoenig commented 2 years ago

Hi all, I am still fighting with the noise models and are stuck with the following PETab problem: icg_noise.zip The linter gives the following errors:

Mismatch of noise parameter overrides in:
observableId                             model__Cve_icg
preequilibrationConditionId                         NaN
simulationConditionId          Andersen1999_task_icg_iv
datasetId                            Andersen1999_dset0
replicateId                                          R1
time                                                3.0
measurement                                    0.007377
noiseParameters                       sd_model__Cve_icg
observableParameters                                NaN
Name: 0, dtype: object
Expected 2 but got 0
Not OK

I want the following noise model for all my observables, i.e. additive and multiplicative noise via

noiseParameter2_model__Cve_icg + noiseParameter1_model__Cve_icg * Cve_icg

so I wrote this as noise formula in the obervable table. In addition I wrote for the measurements in the noiseParameters a parameter sd_<observable> and defined these in the parameters table. I tried various combinations of things but cannot get a valid PETab.

I want to define the following:

The tutorial only uses a simple additive noise example so not exactly sure what to do. Sorry for the basic questions, just difficult to figure this out from the documentation alone. Thanks for any help/hints.

Best Matthias

`

dilpath commented 2 years ago

As the noise formula contains two noise values that need to be overridden

noiseParameter1_model__Cve_icg
noiseParameter2_model__Cve_icg

the PEtab measurements table should specify two values to override them.

These can be specified as a ;-delimited list in the noiseParameters column of the measurements table.

Here's an example that uses 1;sd_model__Cve_icg to specify

noiseParameter1_model__Cve_icg=1
noiseParameter2_model__Cve_icg=sd_model__Cve_icg

for the first measurement in your measurements table.

observableId                             model__Cve_icg
preequilibrationConditionId                         NaN
simulationConditionId          Andersen1999_task_icg_iv
datasetId                            Andersen1999_dset0
replicateId                                          R1
time                                                3.0
measurement                                    0.007377
noiseParameters                     1;sd_model__Cve_icg
observableParameters                                NaN
Name: 0, dtype: object

Looks like the PEtab linter output is incorrect, since the error is Expected 2 but got 0 but should be Expected 2 but got 1. Nevermind, already fixed in develop.

matthiaskoenig commented 2 years ago

Thanks. This makes sense and works.