|
Unfit
3.1.1
Data fitting and optimization software
|
An example data fitting problem with four parameters. More...
#include <NonStationaryMarkov.hpp>
Public Member Functions | |
| NonStationaryMarkov (const std::vector< std::vector< double >> &markov_data) | |
| std::vector< double > | operator() (const std::vector< double > ¶m) |
Public Member Functions inherited from Unfit::GenericCostFunction | |
| virtual | ~GenericCostFunction () |
Private Attributes | |
| const std::vector< std::vector< double > > | markov_data_ |
An example data fitting problem with four parameters.
Here the goal is to find a function that describes eta (the opening rate) from a non-stationary Markov ion channel model in terms of both voltage and time (sodium channel). The equation to fit is:
eta = A1 exp(vm/A2) exp(−(t−A3)^2 / 2(A4)^2)
The goal is to find the values of A1, A2, A3 & A4 that best fit the data. In terms of the model, A1 = param[0], A2 = param[1], A3 = param[2] and A4 = param[2].
|
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 of data at eight clamping voltages (a vector of vectors).
markov_data[0] stores the time step markov_data[1] stores the eta values at voltage value, -60mV markov_data[2] stores the eta values at voltage value, -50mV markov_data[3] stores the eta values at voltage value, -40mV markov_data[4] stores the eta values at voltage value, -30mV markov_data[5] stores the eta values at voltage value, -20mV markov_data[6] stores the eta values at voltage value, -10mV markov_data[7] stores the eta values at voltage value, 0mV
Intended use : NonStationaryMarkov cost_func(markov_data);
| markov_data | A vector of vectors of experimental data (eta) |
|
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 of vectors to store the experimental data
1.8.13