gbradburd / SpaceMix

29 stars 10 forks source link

Burnin valid values? #13

Open asinensis opened 6 years ago

asinensis commented 6 years ago

Hi,

What is the valid value for burnin when displaying the SpaceMix results if I want to exclude, for example, data for 0-10,000 MCMC interations out of total 100,000 iterations?

gbradburd commented 6 years ago

The burnin argument in the function make.spacemix.map.list() specifies the number of sampled MCMC iterations that will be ignored when making the output list object. As the documentation states, "a value of 200 means that the first 200 sampled iterations of the MCMC will be discarded when calculating credible intervals."

I'm not sure whether you're trying to drop the first 1e4 MCMC iterations, or the first 1e4 sampled MCMC iterations. If the latter, the correct burnin value is just 1e4. If the former, then it depends on the samplefreq value (the frequency with which samples are logged from the MCMC) you specified when you called run.spacemix.analysis(). If you specified a number of MCMC iterations (ngen) of 1e5 and a samplefreq of 1, then you're sampling every iteration of the chain, so if you wanted to drop the first 1e4 MCMC iterations, you should specify a burnin of 1e4. If your samplefreq was 5e3, meaning that you were logging samples from the chain every 5,000 iterations, then to burn-in the first 1e4 MCMC iterations, you'd specify a burnin of 2.

Please let me know if that resolves your question.