pastas.stats.metrics.kge#
- pastas.stats.metrics.kge(obs: pandas.Series, sim: pandas.Series, missing: str = 'drop', weighted: bool = False, max_gap: int = 30, modified: bool = False, **kwargs) float#
Compute the (weighted) Kling-Gupta Efficiency (KGE).
- Parameters:
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.
Notes
The (weighted) Kling-Gupta Efficiency Kling et al. [2012] is computed as follows:
\[\begin{split}\\text{KGE} = 1 - \\sqrt{(r-1)^2 + (\\beta-1)^2 - (\\gamma-1)^2}\end{split}\]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.