baudren / montepython_public

Public repository for the Monte Python Code
MIT License
65 stars 114 forks source link

Over-sampling with multiple experiments/likelihoods #117

Open noller opened 6 years ago

noller commented 6 years ago

Hi all,

I have a question re over-sampling. My understanding is that, if I have a param file of the following form

data.experiment=[exp1,exp2]
data.over_sampling=[1, N_1, N_2]

where I have two experiments/likelihoods exp1 and exp2 (both of which have nuisance parameters), then the nuisance parameters of exp1 are sampled N_1 times more often and those of exp2 N_2 times more often than the cosmological parameters. Also, the over_sampling array has the same length as the number of experiments with nuisance parameters used, so if I added further experiments/likelihoods without nuisance parameters, I should be able to run with the same data.over_sampling=[1, N_1, N_2]. Is that correct?

The problem I find then is this: I have a param file of the following form

data.experiment=[exp1,exp2,exp3,exp4,exp5,exp6,exp7]
data.over_sampling=[1, N_1, N_2, N_3, N_4]

The strange thing is that only two of the likelihoods have nuisance parameters (one has one and the other has two such parameters), so I would have expected that I can specify data.over_sampling=[1, N_1, N_2], but montepython refuses to run with any over_sampling array length other than 5. Note that this happens regardless of how the experiments are ordered. Do you know why this happens and what the meaning of the four different N_i is in this case?

To give some further details: I tried to debug this a little bit and found that, when running this param file, data.py collects the correct nuisance parameters from the two experiments in its internal "nuisance" and "used_nuisance" arrays. However, "self.block_parameters" becomes sth like [8, 9, 9, 9, 11], so this seems to be where the strange over_sampling array length comes from.

Many thanks and best wishes, Johannes