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