cosmomc - importance sampling - #of samples

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Anze Slosar
Posts: 183
Joined: September 24 2004
Affiliation: Brookhaven National Laboratory

cosmomc - importance sampling - #of samples

Post by Anze Slosar » February 21 2006

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?

Antony Lewis
Posts: 1501
Joined: September 23 2004
Affiliation: University of Sussex

Re: cosmomc - importance sampling - #of samples

Post by Antony Lewis » February 21 2006

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.

Post Reply