BayesianTools
BayesianTools copied to clipboard
summary() should return a list with useful values
currently, summary() returns the correlation matrix of the parameters, would be more sensible to return a list with all summary statistics calculated
As far as i can see, the summary.mcmc ( https://github.com/florianhartig/BayesianTools/blob/7a310be799925a5985f5671ea1b213f7f6802cef/BayesianTools/R/classMcmcSampler.R#L118 ) prints : Type of MCMC sampler, Nr. Chains, Iterations per chain ,Rejection rate, Effective sample size, Runtime, Parameters( MAP 2.5% median 97.5% ), DIC, Gelman Rubin multivariate psrf and the corrleation matrix.
Should i turn this into a List?
yes, I think this would be good, returning all essential parameters as a list. You could additionally return things that are not printed. Have a look at how other important classes handle this, for example summary.lm for an lm
Johannes, did you do this?
Actually, working on https://github.com/florianhartig/BayesianTools/issues/166, I just saw that this looks more complicated as I thought.
The summary() function is not very well structured, in particular that it has very similar code for mcmc and mcmc.list, which would have better called the same code.
I wonder if it would be better to rewrite this function, in a way what we
- first extract the neccessary info into a standardized list
- then print this
- return this list
In this way, it would also be easier to re-use summary for the SMC samplers, which currently don't have a proper summary function