The alpha NSE decomposition is the fraction of the standard deviations of simulations and observations.
\[\alpha = \frac{\sigma_s}{\sigma_o},\]
where \(\sigma_s\) is the standard deviation of the simulations (here, sim) and \(\sigma_o\) is the
standard deviation of the observations (here, obs).
The beta NSE decomposition is the difference of the mean simulation and mean observation divided by the standard
deviation of the observations.
\[\beta = \frac{\mu_s - \mu_o}{\sigma_o},\]
where \(\mu_s\) is the mean of the simulations (here, sim), \(\mu_o\) is the mean of the observations
(here, obs) and \(\sigma_o\) the standard deviation of the observations.
where \(Q_{s,\text{lower/upper}}\) corresponds to the FDC of the simulations (here, sim) at the lower and
upper bound of the middle section and \(Q_{o,\text{lower/upper}}\) similarly for the observations (here,
obs).
Parameters:
obs (DataArray) – Observed time series.
sim (DataArray) – Simulated time series.
lower (float, optional) – Lower bound of the middle section in range ]0,1[, by default 0.2
upper (float, optional) – Upper bound of the middle section in range ]0,1[, by default 0.7
Returns:
Slope of the middle section of the flow duration curve.
where \(r\) is the correlation coefficient, \(\alpha\) the \(\alpha\)-NSE decomposition,
\(\beta_{\text{KGE}}\) the fraction of the means and \(s_r, s_\alpha, s_\beta\) the corresponding weights
(here the three float values in the weights parameter).
Parameters:
obs (DataArray) – Observed time series.
sim (DataArray) – Simulated time series.
weights (List[float]) – Weighting factors of the 3 KGE parts, by default each part has a weight of 1.
where \(Q_{s,p}\) are the simulated peaks (here, sim), \(Q_{o,p}\) the observed peaks (here, obs) and
P is the number of peaks.
Uses scipy.find_peaks to find peaks in the observed time series. The observed peaks indices are used to subset
observed and simulated flows. Finally, the MAPE metric is calculated as the mean absolute percentage error
of observed peak flows and corresponding simulated flows.
Uses scipy.find_peaks to find peaks in the observed time series. Starting with all observed peaks, those with a
prominence of less than the standard deviation of the observed time series are discarded. Next, the lowest peaks
are subsequently discarded until all remaining peaks have a distance of at least 100 steps. Finally, the
corresponding peaks in the simulated time series are searched in a window of size window on either side of the
observed peaks and the absolute time differences between observed and simulated peaks is calculated.
The final metric is the mean absolute time difference across all peaks. For more details, see Appendix of [8]
Parameters:
obs (DataArray) – Observed time series.
sim (DataArray) – Simulated time series.
window (int, optional) – Size of window to consider on each side of the observed peak for finding the simulated peak. That is, the total
window length to find the peak in the simulations is \(2 * \text{window} + 1\) centered at the observed
peak. The default depends on the temporal resolution, e.g. for a resolution of ‘1D’, a window of 3 is used and
for a resolution of ‘1H’ the the window size is 12.
resolution (str, optional) – Temporal resolution of the time series in pandas format, e.g. ‘1D’ for daily and ‘1H’ for hourly.
datetime_coord (str, optional) – Name of datetime coordinate. Tried to infer automatically if not specified.
Uses scipy.find_peaks to find peaks in the observed and simulated time series above a certain percentile. Counts
the number of peaks in obs that do not exist in sim within the specified window.
Parameters:
obs (DataArray) – Observed time series.
sim (DataArray) – Simulated time series.
window (int, optional) – Size of window to consider on each side of the observed peak for finding the simulated peak. That is, the total
window length to find the peak in the simulations is \(2 * \text{window} + 1\) centered at the observed
peak. The default depends on the temporal resolution, e.g. for a resolution of ‘1D’, a window of 1 is used and
for a resolution of ‘1H’ the the window size is 12. Note that this is a different default window size than is
used in the peak-timing metric for ‘1D’.
resolution (str, optional) – Temporal resolution of the time series in pandas format, e.g. ‘1D’ for daily and ‘1H’ for hourly.
percentile (float, optional) – Only consider peaks above this flow percentile (0, 100).
datetime_coord (str, optional) – Name of datetime coordinate. Tried to infer automatically if not specified.