Data2Dynamics / d2d

a modeling environment tailored to parameter estimation in dynamical systems
https://github.com/Data2Dynamics/d2d
57 stars 28 forks source link

Estimating parameters with constant sum #173

Closed TimonKapischke closed 1 year ago

TimonKapischke commented 1 year ago

Is it possible to fit parameters that sum up to a given constant?

I have a ODE system with some parameters that sum up to 1. Lets assume we have some unknown parameters a,b,c,d. Every parameter is >0 and a+b+c+d=1. Is it possible to fit these kind of parameters with d2d? (a,b,c,d are probabilities)

I tried it with the OBSERVABLES section and fitted the sum of the parameters to observations of 1 for every time point but the sum of the fitted parameters is slightly more or less than 1.

Is it possible to fit them exactly to 1? A solution that comes to my mind is that you fit a,b,c and calculate d afterwards with d=1-a-b-c. But I am not sure how to implement this correctly in d2d.

best, Timon

clemenskreutz commented 1 year ago

D2D does not support hard constaints. You have to replace one parameter, e.g. d = 1-a-b-c. This can be done in the CONDITIONS (or SUBSTITUIONS) section of the model or data def files.