Page 1 of 1

cosmomc - importance sampling - #of samples

Posted: February 21 2006
by Anze Slosar
I find that after importance sampling (with indep=1) the number of samples in the importance sampled chains is far larger, by a factor of 4-5 or so than the number of samples in the original .txt file.

Why this is so? Isn't every accepted sample included in the original .txt file?

Re: cosmomc - importance sampling - #of samples

Posted: February 21 2006
by Antony Lewis
Every sample is included, but in the compressed form of having > 1 weight in the first column when samples are repeated. The importance sampled samples are always put out on separate lines (usually you want to importance sample thinned samples - saves time - in which case the chance of duplicates is very small).

In your case where you are including all samples the number of lines will increase by the inverse of the acceptance rate of the original chain.