The default behavior for adding and solving with noisemodels has changed from Pastas 1.5. Find more information here


mae(obs=None, sim=None, res=None, missing='drop', weighted=False, max_gap=30)[source]#

Compute the (weighted) Mean Absolute Error (MAE).

  • sim (pandas.Series, optional) – Series with the simulated values.

  • obs (pandas.Series, optional) – The Series with the observed values.

  • res (pandas.Series, optional) – The Series with the residual values. If time series for the residuals are provided, the sim and obs arguments are ignored. Note that the residuals must be computed as obs - sim here.

  • missing (str, optional) – string with the rule to deal with missing values. Only “drop” is supported now.

  • weighted (bool, optional) – Weight the values by the normalized time step to account for irregular time series. Default is True.

  • max_gap (int, optional) – maximum allowed gap period in days to use for the computation of the weights. All time steps larger than max_gap are replace with the max_gap value. Default value is 30 days.

Return type



The Mean Absolute Error (MAE) between the observed (\(y_o\)) and simulated (\(y_s\)) time series is computed as follows:

\[\text{MAE} = \sum_{i=1}^{N} w_i |y_s - y_o|\]

where \(N\) is the number of observations in the observed time series.