Unfit  3.1.1
Data fitting and optimization software
Public Member Functions | Private Attributes | List of all members
Unfit::Examples::NonStationaryMarkov Class Reference

An example data fitting problem with four parameters. More...

#include <NonStationaryMarkov.hpp>

Inheritance diagram for Unfit::Examples::NonStationaryMarkov:
Unfit::GenericCostFunction

Public Member Functions

 NonStationaryMarkov (const std::vector< std::vector< double >> &markov_data)
 
std::vector< double > operator() (const std::vector< double > &param)
 
- Public Member Functions inherited from Unfit::GenericCostFunction
virtual ~GenericCostFunction ()
 

Private Attributes

const std::vector< std::vector< double > > markov_data_
 

Detailed Description

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].

Constructor & Destructor Documentation

◆ NonStationaryMarkov()

Unfit::Examples::NonStationaryMarkov::NonStationaryMarkov ( const std::vector< std::vector< double >> &  markov_data)
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);

Parameters
markov_dataA vector of vectors of experimental data (eta)

Member Function Documentation

◆ operator()()

std::vector<double> Unfit::Examples::NonStationaryMarkov::operator() ( const std::vector< double > &  param)
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)

Parameters
paramA vector containing the current estimates of the parameters we are trying to fit
Returns
A vector containing the residuals

Implements Unfit::GenericCostFunction.

Member Data Documentation

◆ markov_data_

const std::vector<std::vector<double> > Unfit::Examples::NonStationaryMarkov::markov_data_
private

A vector of vectors to store the experimental data


The documentation for this class was generated from the following file: