Logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2025 Patrick Müller. All rights reserved.

qspec.analyze.linear_alpha_fit  (  x y sigma_x = None sigma_y = None corr = None func = 'york_fit' alpha = 0 find_alpha = True report = False show = False ** kwargs  )[source]

Parameters:
xndarray | Iterable

The x data.

yndarray | Iterable

The y data.

sigma_xarray_like

The 1-sigma uncertainty of the x data.

sigma_yarray_like

The 1-sigma uncertainty of the y data.

corrndarray | Iterable

The correlation coefficients between the x and y data.

funcCallable | str

The fitting routine. Supports {'york_fit', 'linear_fit', 'linear_monte_carlo'}.

alphascalar

An x-axis offset to reduce the correlation coefficient between the y-intercept and the slope.

find_alphabool

Whether to search for the best 'alpha'. Uses the given 'alpha' as a starting point. May not give the desired result if 'alpha' was initialized too far from its optimal value.

reportbool

Whether to print the result of the fit.

showbool

Whether to plot the fit result.

kwargsNone

Additional keyword arguments are passed to the fitting routine.

Returns:
outNone

popt, pcov, alpha. The best y-intercept and slope, their covariance matrix and the used alpha.

API navigation