Closed pepaaran closed 1 year ago
We definitely should make it possible to return the full object returned by the respective library/function. I propose something like the following. Instead of the current
return(out_optim)
we should be doing something like
return(par = par, mod = mod)
where par
is the named vector of best estimates of parameters and mod
is the model object, returned here by either GenSA::GenSA()
or BayesianTools::runMCMC()
. Returning mod
may be made optional.
I will go ahead with that, I like the idea. Thanks Beni
I think this is fixed by: https://github.com/computationales/rsofun/pull/112 or earlier correct?
No, I actually corrected this yesterday but haven't done a pull request for it. Will do today.
Ok, no worries. That's why I didn't close the issue yet.
Closing, fixed per #132
Depending on whether we use GenSA or BayesianTools as optimizers for the calibration, the output returned by
calib_sofun
changes.With GenSA, the output is a list (shown below), which gives quite some useful information about the iterations of the optimization, the minimum value of the cost function and the values of the parameters at the minimum (ie, calibrated).
While with BayesianTools, we're only returning a list with the calibrated parameter values.
We should agree what information is useful and should be returned with the optimized values of the parameters, or if we return only the parameter values. Of course the output of the two optimizers will be different, so we need to find a way to structure the output in an analogous way (or document it such that people know what to expect). I think especially with BayesianTools we should provide more information, since it's almost more interesting to look at the posterior distribution of the parameters than the calibrated value and the user should be able to look at the convergence of the algorithm too. Furthermore, we would avoid having a blackbox
calib_sofun
function that makes it difficult to debug cost functions written by users.