Join GitHub today
Thinning sample and increasing burnin after run? #23
After a recent sample run, I used pymc.Matplot.plot to display the trace Here. Obviously it could benefit from a longer burnin period as well as sample thinning. It's clear how to set these parameters before I start the run-- but I'm not sure how to do it after in a way that produces a pymc.database.pickle.Trace object such that I can still use the plot function and .stats() method. It's suggested in the documentation (section 3.5.1) that this is possible, however I cannot find the functions that implement either thinning or revision of the burnin. Do they exist? If so, how can I access them?
You can burn and thin after sampling by using Numpy's array indexing, since the traces are Numpy arrays. So, if you wanted to do an extra burn in of 1000 iterations on a parameter called
If you wanted to thin the same trace by a factor of 10:
Note that thinning is essentially a waste of time, and I have considered removing it as an argument altogether. All that happens in an un-thinned trace (that is, one with autocorrelation) is that the effective sample size is reduced. When you thin, you do the exact same thing -- you reduce the sample size, but in a direct way. So, thinning does not buy you anything, and may actually cost you, relative to just using the trace as-is.