|
Unfit
3.1.1
Data fitting and optimization software
|
Fit the parameters in a model of a genetic switch. More...
#include <GeneticSwitch.hpp>
Public Member Functions | |
| GeneticSwitch (const std::vector< double > &z_a, double dt) | |
| std::vector< double > | operator() (const std::vector< double > ¶m) |
Public Member Functions inherited from Unfit::GenericCostFunction | |
| virtual | ~GenericCostFunction () |
Private Attributes | |
| const std::vector< double > | z_a_data_ |
| const double | dt_ |
Fit the parameters in a model of a genetic switch.
An example two ordinary differential equations (ODE) data fitting problem. The equations describe genetic switch between two genes, z_a and z_b, for protein regulation. They depend on four constants, u, n, v1 and v2. Here the goal is to fit these constants given experimental data for z_a. The two ODEs are:
dz_a/dt = u/(1 + z_b^n) - z_a - v1 dz_b/dt = u/(1 + z_b^n) - z_b - v2
The initial conditions are z_a(0) = 10, and z_b(0) = 10, and the goal is to find the values of u, n, v1 & v2 that best fit the data. In terms of the model, u = param[0], n = param[1], v1 = param[2] and v2 = param[3].
|
inline |
Create the cost function. Here the experimental data must be passed in, and cannot be changed (if you want to, just create another cost function object). Here the experimental data is a vector containing the value of z_a, and the time step used in the data collection.
Intended use : GeneticSwitch cost_func(z_a, t);
| z_a | A vector of experimental z_a values |
| dt | The experimental time step |
|
inlinevirtual |
Calculate the linear distance (residuals) between our model and the data. This method encapsulates the model, and expects the current estimates of the unknown parameters as an input. See the class documentation for details about the model.
Intended use : residuals = cost_func(param)
| param | A vector containing the current estimates of the parameters we are trying to fit |
Implements Unfit::GenericCostFunction.
|
private |
A vector to store the time step, dt
|
private |
A vector to store the experimental data, Z_A
1.8.13