xscale.signal.fitting.linreg

xscale.signal.fitting.linreg(array, dim=None, coord=None)

Compute a linear regression using a least-square method

Parameters:
x : xarray.DataArray

The array on which the linear regression is computed

dim : str, optional

The dimension along which the data will be fitted. If not precised, the first dimension will be used

coord : xarray.Coordinate, optional

The coordinates used to based the linear regression on.

Returns:
res : xr.Dataset

A Dataset containing the slope and the offset of the linear regression