smpl.fit

Simplified Fitting.

Uses scipy.curve_fit (no x errors) or scipy.odr (with x errors).

Functions

Chi2(datax, datay, function, ff, **kwargs)

Chi2 - Goodness of Fit

R2(datax, datay, function, ff, **kwargs)

R2 - Coefficient of determination

auto(datax, datay[, funcs])

Automatically loop over functions and fit the best one.

data_split(datax, datay, **kwargs)

Split data + errors

fit(datax, datay, function, **kwargs)

Returns a fit of function to datax and datay.

fit_kwargs(kwargs)

Set default fit_kwargs() if not set.

fit_split(datax, datay, **kwargs)

Splits datax and datay into (x,y,xerr,yerr).

unv(arr)

Return the nominal values of the numbers in NumPy array arr.

usd(arr)

Return the standard deviations of the numbers in NumPy array arr.

Classes

Fitter(value)

Different implementations to perform a fit.

Model(fcn[, fjacb, fjacd, extra_args, ...])

The Model class stores information about the function you wish to fit.

ODR(data, model[, beta0, delta0, ifixb, ...])

The ODR class gathers all information and coordinates the running of the main fitting routine.

RealData(x[, y, sx, sy, covx, covy, fix, meta])

The data, with weightings as actual standard deviations and/or covariances.

tqdm(*_, **__)

Decorate an iterable object, returning an iterator which acts exactly like the original iterable, but prints a dynamically updating progressbar every time a value is requested.

Exceptions

LinAlgError

Generic Python-exception-derived object raised by linalg functions.