skg.exp

Exponential fit with and additive bias of the form A + Be^{Cx}.

Todo

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

Todo

Add tests.

Todo

Add nan_policy argument.

Todo

Add PEP8 check to formal tests.

Todo

Add axis parameter.

Functions

exp_fit(x, y[, sorted]) Exponential fit of the form A + Be^{Cx}.
model(x, a, b, c) Compute y = A + Be^{Cx}.
skg.exp.exp_fit(x, y, sorted=True)[source]

Exponential fit of the form A + Be^{Cx}.

This implementation is based on the approximate solution to integral equation (22), 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:

a, b, c – A 3-element array of optimized fitting parameters. The first element is the additive bias, the second the multiplicative, and the third the exponential.

Return type:

ndarray

References

skg.exp.model(x, a, b, c)[source]

Compute y = A + Be^{Cx}.

Parameters:
  • x (array-like) – The value of the model will be the same shape as the input.
  • a (float) – The additive bias.
  • b (float) – The multiplicative bias.
  • c (float) – The exponent.
Returns:

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

Return type:

array-like