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


kge(obs, sim, missing='drop', weighted=False, max_gap=30, modified=False)[source]#

Compute the (weighted) Kling-Gupta Efficiency (KGE).

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

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

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

  • modified (bool, optional) – Use the modified KGE as proposed by Kling et al. [2012]. According to the article this ensures that the bias and variability ratios are not cross-correlated, which otherwise may occur when inputs are biased.

Return type



The (weighted) Kling-Gupta Efficiency Kling et al. [2012] is computed as follows:

\[\text{KGE} = 1 - \sqrt{(r-1)^2 + (\beta-1)^2 - (\gamma-1)^2}\]

where \(\beta = \bar{x} / \bar{y}\) and \(\gamma = \frac{\bar{\sigma}_x}{\bar{\sigma}_y}\). If modified equals True, \(\gamma = \frac{\bar{\sigma}_x / \bar{x}}{\bar{\sigma}_y / \bar{y}}\). If weighted equals True, the weighted mean, variance and pearson correlation are used.