Stimfit @PACKAGE_VERSION@
Loading...
Searching...
No Matches
stfnum Namespace Reference

Classes

struct  parInfo
 Information about parameters used in storedFunc. More...
struct  storedFunc
 Function used for least-squares fitting. More...
class  Table
 A table used for printing information. More...

Typedefs

typedef boost::function< double(double, const Vector_double &)> Func
 A function taking a double and a vector and returning a double.
typedef boost::function< Vector_double(double, const Vector_double &)> Jac
 The jacobian of a stfnum::Func.
typedef boost::function< double(double, double, double, double, double)> Scale
 Scaling function for fit parameters.
typedef boost::function< Table(const Vector_double &, const std::vector< stfnum::parInfo >, double)> Output
 Print the output of a fit into a stfnum::Table.
typedef boost::function< void(const Vector_double &, double, double, double, double, double, Vector_double &)> Init
 Initialising function for the parameters in stfnum::Func to start a fit.

Enumerations

enum  direction { up , down , both , undefined_direction }
 The direction of peak calculations. More...
enum  baseline_method { mean_sd = 0 , median_iqr = 1 }
 Methods for Baseline computation. More...

Functions

template<typename T>
linFit (const std::vector< T > &x, const std::vector< T > &y, T &m, T &c)
 Performs a linear fit.
double StfnumDll lmFit (const Vector_double &data, double dt, const stfnum::storedFunc &fitFunc, const Vector_double &opts, bool use_scaling, Vector_double &p, std::string &info, int &warning)
 Uses the Levenberg-Marquardt algorithm to perform a non-linear least-squares fit.
double flin (double x, const Vector_double &p)
 Linear function.
void flin_init (const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
 Dummy function to be passed to stfnum::storedFunc for linear functions.
StfnumDll stfnum::storedFunc initLinFunc ()
 initializes a linear function
Vector_double get_scale (Vector_double &data, double oldx)
 Compute and perform normalisation.
StfnumDll Vector_double LM_default_opts ()
 Return default LM options.
StfnumDll double fexp (double x, const Vector_double &p)
 Sum of n exponential functions.
Vector_double fexp_jac (double x, const Vector_double &p)
 Computes the Jacobian of stfnum::fexp().
void fexp_init (const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
 Initialises parameters for fitting stfnum::fexp() to data.
void fexp_init2 (const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
 Yet another initialiser for fitting stfnum::fexp() to data.
StfnumDll double fexpde (double x, const Vector_double &p)
 Monoexponential function with delay.
void fexpde_init (const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
 Initialises parameters for fitting stfnum::fexpde() to data.
StfnumDll double fexpbde (double x, const Vector_double &p)
 Biexponential function with delay.
double fexptde (double x, const Vector_double &p)
 Triexponential function with delay.
void fexpbde_init (const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
 Initialises parameters for fitting stfnum::fexpde() to data.
void fexptde_init (const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
 Initialises parameters for fitting stfnum::fexpde() to data.
StfnumDll double falpha (double x, const Vector_double &p)
 Alpha function.
Vector_double falpha_jac (double x, const Vector_double &p)
 Computes the Jacobian of stfnum::falpha().
StfnumDll double fHH (double x, const Vector_double &p)
 Hodgkin-Huxley sodium conductance function.
StfnumDll double fgauss (double x, const Vector_double &p)
 Computes the sum of an arbitrary number of Gaussians.
Vector_double fgauss_jac (double x, const Vector_double &p)
 Computes the Jacobian of a sum of Gaussians.
StfnumDll double fgnabiexp (double x, const Vector_double &p)
 power of 1 sodium conductance function.
Vector_double fgnabiexp_jac (double x, const Vector_double &p)
 Computes the Jacobian of stfnum::fgnabiexp().
void falpha_init (const Vector_double &data, double base, double peak, double RTLoHI, double HalfWidth, double dt, Vector_double &pInit)
 Initialises parameters for fitting stfnum::falpha() to data.
void fgauss_init (const Vector_double &data, double base, double peak, double RTLoHI, double HalfWidth, double dt, Vector_double &pInit)
 Initialises parameters for fitting stfnum::fgauss() to data.
void fHH_init (const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
 Initialises parameters for fitting stfnum::falpha() to data.
void fgnabiexp_init (const Vector_double &data, double base, double peak, double RTLoHi, double HalfWidth, double dt, Vector_double &pInit)
 Initialises parameters for fitting stfnum::falpha() to data.
double xscale (double param, double xscale, double xoff, double yscale, double yoff)
 Scales a parameter that linearly depends on x.
double xunscale (double param, double xscale, double xoff, double yscale, double yoff)
 Unscales a parameter that linearly depends on x.
double yscale (double param, double xscale, double xoff, double yscale, double yoff)
 Scales a parameter that linearly depends on y.
double yscaleoffset (double param, double xscale, double xoff, double yscale, double yoff)
 Scales a parameter that linearly depends on y and adds an offset.
double yunscale (double param, double xscale, double xoff, double yscale, double yoff)
 Unscales a parameter that linearly depends on y.
double yunscaleoffset (double param, double xscale, double xoff, double yscale, double yoff)
 Unscales a parameter that linearly depends on y and removes the offset.
std::vector< stfnum::parInfogetParInfoExp (int n_exp)
 Creates stfnum::parInfo structs for n-exponential functions.
stfnum::Table outputWTau (const Vector_double &p, const std::vector< stfnum::parInfo > &parsInfo, double chisqr)
 Calculates a weighted time constant.
std::size_t whereis (const Vector_double &data, double value)
 Finds the index of data where value is encountered for the first time.
StfnumDll std::vector< stfnum::storedFuncGetFuncLib ()
 Returns the library of functions for non-linear regression.
StfnumDll double base (enum stfnum::baseline_method method, double &var, const std::vector< double > &data, std::size_t llb, std::size_t ulb)
 Calculate the average of all sampling points between and including llb and ulb.
StfnumDll double peak (const std::vector< double > &data, double base, std::size_t llp, std::size_t ulp, int pM, stfnum::direction, double &maxT)
 Find the peak value of data between llp and ulp.
StfnumDll double threshold (const std::vector< double > &data, std::size_t llp, std::size_t ulp, double slope, double &thrT, std::size_t windowLength)
 Find the value within data between llp and ulp at which slope is exceeded.
StfnumDll double risetime (const std::vector< double > &data, double base, double ampl, double left, double right, double frac, std::size_t &tLoId, std::size_t &tHiId, double &tLoReal)
 Find 20 to 80% rise time of an event in data.
StfnumDll double risetime2 (const std::vector< double > &data, double base, double ampl, double left, double right, double frac, double &innerTLoReal, double &innerTHiReal, double &outerTLoReal, double &outerTHiReal)
 Find 20 to 80% rise time of an event in data.
StfnumDll double t_half (const std::vector< double > &data, double base, double ampl, double left, double right, double center, std::size_t &t50LeftId, std::size_t &t50RightId, double &t50LeftReal)
 Find the full width at half-maximal amplitude of an event within data.
StfnumDll double maxRise (const std::vector< double > &data, double left, double right, double &maxRiseT, double &maxRiseY, std::size_t windowLength)
 Find the maximal slope during the rising phase of an event within data.
StfnumDll double maxDecay (const std::vector< double > &data, double left, double right, double &maxDecayT, double &maxDecayY, std::size_t windowLength)
 Find the maximal slope during the decaying phase of an event within data.
Vector_double d3_np_fs (Vector_double &a, const Vector_double &b)
void dvec_bracket3 (const Vector_double &t, double tval, int &left)
Vector_double spline_cubic_set (const Vector_double &t, const Vector_double &y, int ibcbeg, double ybcbeg, int ibcend, double ybcend)
double spline_cubic_val (const Vector_double &t, double tval, const Vector_double &y, const Vector_double &ypp, double &ypval, double &yppval)
Vector_double nojac (double x, const Vector_double &p)
 Dummy function, serves as a placeholder to initialize functions without a Jacobian.
double noscale (double param, double xscale, double xoff, double yscale, double yoff)
 Dummy function, serves as a placeholder to initialize parameters without a scaling function.
Table defaultOutput (const Vector_double &pars, const std::vector< parInfo > &parsInfo, double chisqr)
 Default fit output function, constructing a stfnum::Table from the parameters, their description and chisqr.
template<typename T>
SQR (T a)
 Calculates the square of a number.
StfnumDll Vector_double filter (const Vector_double &toFilter, std::size_t filter_start, std::size_t filter_end, const Vector_double &a, int SR, stfnum::Func func, bool inverse=false)
 Convolves a data set with a filter function.
std::map< double, int > histogram (const Vector_double &data, int nbins=-1)
 Computes a histogram.
StfnumDll Vector_double deconvolve (const Vector_double &data, const Vector_double &templ, int SR, double hipass, double lopass, stfio::ProgressInfo &progDlg)
 Deconvolves a template from a signal.
template<class T>
std::vector< T > cubicSpline (const std::vector< T > &y, T oldF, T newF)
 Interpolates a dataset using cubic splines.
template<class T>
std::vector< T > diff (const std::vector< T > &input, T x_scale)
 Differentiate data.
StfnumDll double integrate_simpson (const Vector_double &input, std::size_t a, std::size_t b, double x_scale)
 Integration using Simpson's rule.
StfnumDll double integrate_trapezium (const Vector_double &input, std::size_t a, std::size_t b, double x_scale)
 Integration using the trapezium rule.
int linsolv (int m, int n, int nrhs, Vector_double &A, Vector_double &B)
 Solves a linear equation system using LAPACK.
StfnumDll Vector_double quad (const Vector_double &data, std::size_t begin, std::size_t end)
 Solve quadratic equations for 3 adjacent sampling points.
StfnumDll Vector_double detectionCriterion (const Vector_double &data, const Vector_double &templ, stfio::ProgressInfo &progDlg)
 Computes the event detection criterion according to Clements & Bekkers (1997).
StfnumDll std::vector< int > peakIndices (const Vector_double &data, double threshold, int minDistance)
 Searches for positive-going peaks.
StfnumDll Vector_double linCorr (const Vector_double &va1, const Vector_double &va2, stfio::ProgressInfo &progDlg)
 Computes the linear correlation between two arrays.
StfnumDll double fgaussColqu (double x, const Vector_double &p)
 Computes a Gaussian that can be used as a filter kernel.
double fboltz (double x, const Vector_double &p)
 Computes a Boltzmann function.
double fbessel (double x, int n)
 Computes a Bessel polynomial.
StfnumDll double fbessel4 (double x, const Vector_double &p)
 Computes a 4th-order Bessel polynomial that can be used as a filter kernel.
int fac (int arg)
 Computes the faculty of an integer.
int pow2 (int arg)
 Computes \( 2^{arg} \). Uses the bitwise-shift operator (<<).

Function Documentation

◆ d3_np_fs()

Vector_double stfnum::d3_np_fs ( Vector_double & a,
const Vector_double & b )

◆ dvec_bracket3()

void stfnum::dvec_bracket3 ( const Vector_double & t,
double tval,
int & left )

◆ spline_cubic_set()

Vector_double stfnum::spline_cubic_set ( const Vector_double & t,
const Vector_double & y,
int ibcbeg,
double ybcbeg,
int ibcend,
double ybcend )

Referenced by cubicSpline().

◆ spline_cubic_val()

double stfnum::spline_cubic_val ( const Vector_double & t,
double tval,
const Vector_double & y,
const Vector_double & ypp,
double & ypval,
double & yppval )

Referenced by cubicSpline().