florianhartig / BayesianTools

General-Purpose MCMC and SMC Samplers and Tools for Bayesian Statistics
https://cran.r-project.org/web/packages/BayesianTools/index.html
115 stars 29 forks source link

DREAM and DREAMzs: updateInterval must be >= nCR? #205

Open jds485 opened 4 years ago

jds485 commented 4 years ago

I've found that specifying the updateInterval to be less than nCR results in an error from line 398 in mcmcDREAMzs.R, which is a loop over (k in 1:settings$nCR): ind <- which(abs(CR[,k]-(k/nCR)) < 1e-5)

The error happens because CR is set to have column length equal to updateInterval instead of nCR in line 200: CR <- matrix(1/nCR, nrow = Npop, ncol = settings$updateInterval)

It seems like ncol = settings$nCR should be used in line 200, which would allow for nCR and updateInterval settings to not have this dependency, at least in the DREAMzs function. I think some instances of updateInterval would also need to be changed to nCR in the generateCRvalues function, and possibly other functions.

florianhartig commented 4 years ago

Hi Jared,

thanks for reporting this - I have to admit that I am currently overwhelmed with things, so that various issues in BT have piled up at the moment that should be resolved. I will try to resolve this as fast as possible.

Best, Florian