florianjehn / acme

Code for my PhD project. It has the goal of automated construction of hydrological models with the Catchment Modeling Framework using genetic algorithms.
Apache License 2.0
7 stars 3 forks source link

Include several objective functions with DREAM #25

Closed florianjehn closed 6 years ago

florianjehn commented 6 years ago

DREAM uses this weird objective function, can Spotpy still be used to calculate other objective functions in the progress? For example Klingt Gupta, so in the End one can better compare stuff with ACME?

thouska commented 6 years ago

yes, thats possible, e.g. like this:

def objectivefunction(self,simulation,evaluation):
    like1 = spotpy.likelihoods.gaussianLikelihoodMeasErrorOut(evaluation,simulation)
    like2 = spotpy.objectivefunctions.kge(evaluation,simulation)
    return [like1,like2]

And just for the record, the DREAM objectivefunction is not weird, just different ;)

florianjehn commented 6 years ago

Thanks for the quick replay, did not really think that anyone but me would read this^^ I figured this could be done the way you laid out, but I knowing it for sure is quite helpful!

For me the DREAM objectivefunction will remain weird until I understand what it does ;)

thouska commented 6 years ago

The gaussian likelihood function is not too complex. From the mathematically compexety similar to KGE:

p = -n/2\\log(\\sum_{t=1}^n e_t(x)^2)

with e_t = observation - simulation, and n = len(simulation). So more ore less, just the negative log of the sum of the squared residuals. The value is allways negative. The closer to zero the better is the fit.

florianjehn commented 6 years ago

Ah nice. Thanks. You mean spotpy.likelihoods.gaussianLikelihoodMeasErrorOut?

thouska commented 6 years ago

exactly

florianjehn commented 6 years ago

For now acme will use Latin Hypercube Sampling. Therefore, this is closed. Might need reevaluation in future.