mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
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... | |
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)}} \]
t | [input] the argument. |
t0 | [input] [optional] the center of the curve, defaults to 0. |
a | [input] [optional] the exponent parameter, defaults to 1. |
floatT | is the floating point type of the arguments and the returned value. |
Definition at line 83 of file logistic.hpp.
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 \).
floatT | is the floating point type of the arguments and the returned value. |
[in] | x | the value at which the rise time is specified. |
[in] | thalf | half the rise time, or the time after 0 when f(t) = x. |
Definition at line 59 of file logistic.hpp.