mesmer.stats.LinearRegression.residuals#
- LinearRegression.residuals(predictors, target)#
Calculate the residuals of the fitted linear model
- Parameters:
predictors (dict of xr.DataArray | DataTree | xr.Dataset) – A dict of DataArray objects used as predictors or a DataTree, holding each predictor in a leaf. Each predictor must be 1D and contain dim. If predictors is a xr.Dataset, it must have each predictor as a DataArray.
target (xr.DataArray) – Target DataArray. Must be 2D and contain dim.
- Returns:
residuals (xr.DataArray) – Returns residuals - the difference between the predicted values and target.