Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

likelihoods.py, generalizedLikelihoodFunction residuals not computed correctly #257

Closed
jds485 opened this issue Sep 17, 2020 · 1 comment

Comments

@jds485
Copy link

jds485 commented Sep 17, 2020

The residuals should be with respect to the scaled (bias-corrected) value (E in Schoups and Vrugt, 2010, Eq. 1). They are currently computed with respect to the unscaled value (Y_h in Schoups and Vrugt, 2010, Eq. 2) using the __calcSimpleDeviation function.

A new function is needed, similar to the following:
def __calcSimpleDeviation_bias(data, comparedata, mu_h):
__standartChecksBeforeStart(data, comparedata)
d = np.array(data)
c = np.array(comparedata)
#Adjust c for multiplicative bias parameter:
mu_t = np.exp(mu_h * c)
Et = c * mu_t
return d - Et

The function is called in Line 432.

@thouska
Copy link
Owner

thouska commented Sep 18, 2020

Hi @jds485
thank you for your bugreport and the provided solution! I included your suggested fix. This will be available in spotpy version >=1.5.14

@thouska thouska closed this as completed Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants