alg_decay_fit
full name: tenpy.tools.fit.alg_decay_fit
parent module:
tenpy.tools.fit
type: function
- tenpy.tools.fit.alg_decay_fit(x, 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
andc
are determined via least-squares linear fit with independent variable \(x^{-b}\).- Parameters:
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:]
andy[-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
. Thepower_range
is first divided intopower_mesh[0]
many intervals. Then, for each subsequent entry ofpower_mesh
the smaller region around the best previous guess is further divided into as many intervals.
- Returns:
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