• full name:

  • parent module:

  • type: function, y, npts=5, power_range=(0.01, 4.0), power_mesh=[60, 10])[source]

Fit y to an algebraic decay of the form :math :a * x^{-b} + c.

The exponent b is first determined via a brute-force search with a fixed search grid which is refined in multiple steps. Then, a and c are determined via least-squares linear fit with independent variable \(x^{-b}\).

  • x (array_like [M]) – The independent variable where the data is measured.

  • y (array_like [M]) – The dependent data.

  • npts (int) – The maximum number of points used for the fit. If npts < len(x), only the last npts datapoints, i.e. x[-npts:] and y[-npts:] are used.

  • power_range (tuple(float, float)) – A range that restricts the possible values of the fit exponent b

  • power_mesh (list of float) – Number of points in the search grid for the fit exponent b. The power_range is first divided into power_mesh[0] many intervals. Then, for each subsequent entry of power_mesh the smaller region around the best previous guess is further divided into as many intervals.


  • a (float) – The prefactor of the fitted algebraic decay.

  • b (float) – The (negative) exponent of the fitted algebraic decay.

  • c (float) – The y-intercept of the fitted algebraic decay.

See also