half_max_sigmoid

sofia_redux.toolkit.resampling.half_max_sigmoid(x, x_half=0.0, k=1.0, a=0.0, c=1.0, q=1.0, b=1.0, v=1.0)[source]

Evaluate a special case of the logistic function where f(x0) = 0.5.

The generalized logistic function is given as:

\[f(x) = A + \frac{K - A} {\left( C + Q e^{-B(x - x_0)} \right)^{1/\nu}}\]

and may be evaluated with logistic_curve().

We can manipulate this function so that \(f(x_{half}) = (K + A) / 2\) (the midpoint of the function) by setting the location of maximum growth (\(x_0\)) to occur at:

\[x_0 = x_{half} + \frac{1}{B} \ln{\left( \frac{2^\nu - C}{Q} \right)}\]

Since a logarithm is required, it is incumbent on the user to ensure that no logarithms are taken of any quantity \(\leq 0\), i.e., \((2^\nu - C) / Q > 0\).

Parameters:
xint or float or numpy.ndarray (shape)

The independent variable.

x_halfint or float or numpy.ndarray (shape), optional

The x value for which f(x) = 0.5.

kint or float or numpy.ndarray (shape), optional

The upper asymptote when c is one.

aint or float or numpy.ndarray (shape), optional

The lower asymptote.

cint or float or numpy.ndarray (shape), optional

Typically takes a value of 1. Otherwise, the upper asymptote is a + ((k - a) / c^(1/v)).

qint or float or numpy.ndarray (shape), optional

Related to the value of f(0). Fixes the point of inflection. In this implementation, q is completely factored out after simplifying and does not have any affec

bint or float or numpy.ndarray (shape), optional

The growth rate.

vint or float or numpy.ndarray (shape), optional

Must be greater than zero. Affects near which asymptote the maximum growth occurs (point of inflection).

Returns:
resultfloat or numpy.ndarray

The half-max sigmoid evaluated at x.