skg.gauss_cdf

Gaussian cumulative distribution fit.

The function in this module is asymptotic to zero at negative infinity and to one at positive infinity, as a CDF should be:

f(x) & = \frac{1}{\sqrt{2 \pi} \sigma} \int_{-\inf}^x exp\left(
         -\frac{1}{2}\left(\frac{t - \mu}{\sigma}\right)^2\right)dt \\
     & = \frac{1}{2} +
         \frac{1}{2} erf \left( \frac{x - \mu}{\sqrt{2} \sigma} \right)

A fit to the probability density function for this cumulative distribution is provided in gauss_cdf. For for the unnormalized Gaussian bell curve (with an additional amplitude parameter), see gauss.

Todo

Add proper handling of colinear inputs (and other singular matrix cases).

Todo

Add tests.

Todo

Add nan_policy argument.

Todo

Add axis parameter. Figure out how to do it properly.

Todo

Add PEP8 check to formal tests.

Todo

Include amplitude in integrals.

Todo

Allow broadcasting of x and y, not necessarily identical size

Functions

gauss_cdf_fit(x, y[, sorted]) Gaussian CDF fit of the form \frac{1}{2}+\frac{1}{2}erf\left(\frac{x-\mu}{\sqrt{2}\sigma}\right).
model(x, mu, sigma) Compute y = \frac{1}{2} + \frac{1}{2} erf \left( \frac{x - \mu}{\sqrt{2} \sigma} \right).
skg.gauss_cdf.gauss_cdf_fit(x, y, sorted=True)[source]

Gaussian CDF fit of the form \frac{1}{2}+\frac{1}{2}erf\left(\frac{x-\mu}{\sqrt{2}\sigma}\right).

This implementation is based on the approximate solution to integral equation (11), presented in Régressions et équations intégrales.

Parameters:
  • x (array-like) – The x-values of the data points. The fit will be performed on a raveled version of this array.
  • y (array-like) – The y-values of the data points corresponding to x. Must be the same size as x. The fit will be performed on a raveled version of this array.
  • sorted (bool) – Set to True if x is already monotonically increasing or decreasing. If False, x will be sorted into increasing order, and y will be sorted along with it.
Returns:

mu, sigma – A two-element array containing the estimated mean and standard deviation, in that order.

Return type:

ndarray

References

skg.gauss_cdf.model(x, mu, sigma)[source]

Compute y = \frac{1}{2} + \frac{1}{2} erf \left( \frac{x - \mu}{\sqrt{2} \sigma} \right).

Parameters:
  • x (array-like) – The value of the model will be the same shape as the input.
  • mu (float) – The mean.
  • sigma (float) – The standard deviation.
Returns:

y – An array of the same shape as x, containing the model computed for the given parameters.

Return type:

array-like