mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
The Logistic Function

Utilities for working with the Logistic Function.

Functions

template<typename floatT >
floatT mx::math::func::logistic_param (floatT x, floatT thalf)
 Return the logistic function parameter for a specified rise time. More...
 
template<typename floatT >
floatT mx::math::func::logistic (floatT t, floatT t0=0, floatT a=1)
 Return the value of the logistic function. More...
 

Function Documentation

◆ logistic()

template<typename floatT >
floatT mx::math::func::logistic ( floatT  t,
floatT  t0 = 0,
floatT  a = 1 
)

Return the value of the logistic function.

The logistic function is

\[ f(t) = \frac{1}{1 + e^{-a(t-t_0)}} \]

Parameters
t[input] the argument.
t0[input] [optional] the center of the curve, defaults to 0.
a[input] [optional] the exponent parameter, defaults to 1.
Returns
the value of the logistic function at t
Template Parameters
floatTis the floating point type of the arguments and the returned value.

Definition at line 83 of file logistic.hpp.

◆ logistic_param()

template<typename floatT >
floatT mx::math::func::logistic_param ( floatT  x,
floatT  thalf 
)

Return the logistic function parameter for a specified rise time.

The logistic function is

\[ f(t) = \frac{1}{1 + e^{-a(t-t_0)}} \]

The parameter \( a \) controls how fast the function rises. Here it is specified by the value \( f(t_{1/2}) = x\), where \( 0 < x < 1 \).

Returns
the value of a
Template Parameters
floatTis the floating point type of the arguments and the returned value.
Parameters
[in]xthe value at which the rise time is specified.
[in]thalfhalf the rise time, or the time after 0 when f(t) = x.

Definition at line 59 of file logistic.hpp.