Commit 3c7538ef authored by Oscar Corvi's avatar Oscar Corvi
Browse files

definitive graph for statistical analysis and add RMedSE and bias metrics

parent 5ea1f72f
Pipeline #231461 passed with stage
in 16 seconds
......@@ -432,5 +432,31 @@ def KGE(obs, model):
return(1-ED, r, alpha_KGE, beta_KGE)
def RMedSE(obs, model):
"""Compute the Root Median Squared Error of the model
-----------------------------------------------
in [0, oo[ ; 0 = best
-----------------------------------------------
"""
# removing tuples that are nan values in at least one of the two time series
mask = np.isnan(obs)+np.isnan(model)
model = model[np.where(~mask)]
obs = obs[np.where(~mask)]
N = np.size(obs)
RMedSE = np.sqrt(np.median((obs-model)**2))
return RMedSE
def bias(obs, model):
"""Compute the bias of the simluated time serie
-----------------------------------------------
in [0, oo[ ; 0 = best
-----------------------------------------------
"""
# removing tuples that are nan values in at least one of the two time series
mask = np.isnan(obs)+np.isnan(model)
model = model[np.where(~mask)]
obs = obs[np.where(~mask)]
return (np.mean(obs)-np.mean(model))
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment