|
Unfit
3.1.1
Data fitting and optimization software
|
Fit the time dependence of a three state hidden Markov model. More...
#include <ThreeNaMarkov.hpp>
Public Member Functions | |
| ThreeNaMarkov (const std::vector< double > &open_prob, 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 > | open_prob_ |
| const double | dt_ |
Fit the time dependence of a three state hidden Markov model.
This is an example of fitting a hidden Markov model as can be used to describe an ion channel. There are three states which leads to three ordinary differential equations (ODEs) and four rate constants to fit. The states are labelled C = closed, O = open, and I = inactive. The initial conditions for the states are C = 1.0, O & I = 0.0. The three ODEs are:
dO/dt = kco*C + kio*I - (koc+koi)*O dC/dt = koc*O - kco*C dI/dt = koi*O - kio*I
The goal is to find the values of the k's (rate constants) that best fit the data, which is in the form of O vs time. In terms of the model, kco = param[0], koc = param[1], koi = param[2], kio = param[3]. These ODEs are integrated with the forward Euler method.
|
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 the open probabilities, and the time step used in the data collection.
Intended use : ThreeNaMarkov cost_func(open_prob, dt);
| open_prob | A vector of experimental open probabilities |
| 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 open probabilities
1.8.13