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

Fit the voltage dependence of a Hodgkin Huxley rate constant. More...

#include <HodgkinHuxleyBetaN.hpp>

Inheritance diagram for Unfit::Examples::HodgkinHuxleyBetaN:
Unfit::GenericCostFunction

Public Member Functions

 HodgkinHuxleyBetaN (const std::vector< double > &vm, const std::vector< double > beta_n)
 
std::vector< double > operator() (const std::vector< double > &param)
 
- Public Member Functions inherited from Unfit::GenericCostFunction
virtual ~GenericCostFunction ()
 

Private Attributes

const std::vector< double > vm_
 
const std::vector< double > beta_n_
 

Detailed Description

Fit the voltage dependence of a Hodgkin Huxley rate constant.

Here the goal is to fit the beta_n rate constant (potassium channel inactivation) using data digitized from Hodgkin & Huxley's landmark 1952 paper, Figure 4 (PMCID: PMC1392413) as a function of the cell membrane potential (vm). The equation that is used to fit the data is:

beta_n = A*exp(-vm/B)

The goal is to find the values of A & B that best fit the data. In terms of the model, A = param[0] and B = param[1].

Constructor & Destructor Documentation

◆ HodgkinHuxleyBetaN()

Unfit::Examples::HodgkinHuxleyBetaN::HodgkinHuxleyBetaN ( const std::vector< double > &  vm,
const std::vector< double >  beta_n 
)
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 two vectors, membrane potential (vm) and the rate constant beta_n.

Intended use : HodgkinHuxleyBetaN cost_func(vm, beta_n);

Parameters
vmA vector of membrane potentials
beta_nA vector of experimental beta_n data

Member Function Documentation

◆ operator()()

std::vector<double> Unfit::Examples::HodgkinHuxleyBetaN::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

◆ beta_n_

const std::vector<double> Unfit::Examples::HodgkinHuxleyBetaN::beta_n_
private

A vector to store the experimental rate constant, beta_n

◆ vm_

const std::vector<double> Unfit::Examples::HodgkinHuxleyBetaN::vm_
private

A vector to store the experimental membrane potential, vm


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