pastas.stats.metrics.rmse#

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

Compute the (weighted) Root Mean Squared Error (RMSE).

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

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

  • res (pandas.Series) – Series with the residual values. If time series for the residuals are provided, the sim and obs arguments are ignored.

  • 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 False.

  • 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.

Notes

Computes the Root Mean Squared Error (RMSE) as follows:

\[\text{RMSE} = \sqrt{\sum_{i=1}^{N} w_i n_i^2}\]

where \(N\) is the number of residuals \(n\).