brinckmann / montepython_public

Public repository for the Monte Python Code
MIT License
92 stars 78 forks source link

User-defined parameters not recognized by Montepython analysis. #334

Closed mtagliazucchi closed 11 months ago

mtagliazucchi commented 1 year ago

Hi,

I defined some new parameters in CLASS and I use these parameters in a MCMC with Montepython. CLASS works perfectly with these parameters. I also add the same parameters to 'classy.pyx' ad derived parameters so that sometimes I can compute them as derived parameters.

Montepython works fine during the run with these parameters, in the sense that it effectively sample them and indeed in the chains, in .paramnames file and in .log file they are present. However, when I analyze the chains with the --info option, Montepython is not able to see them, e.g. it does not compute their R-1. The same happens during the run when periodically montepython tries to compute the covariance matrix.

If I analyze the chains with getdist I have no problems.

How can I solve this problem?

brinckmann commented 1 year ago

Hi Matteo,

FYI we also sometimes define the parameters in cclassy.pxd although that's only necessary in some cases, which might not apply here (possibly if you were to use them as derived parameters then classy.pyx would need them defined in cclassy.pxd).

Your error is quite odd, because once MontePython has done its sampling it shouldn't care about CLASS and the new parameters are just strings and the sampled points are just numbers. My best guess is the parameter names might cause a problem with the file reader. Can you share your log.param , or at least the part relevant to the new parameters?

Best, Thejs

mtagliazucchi commented 1 year ago

Hi Thesjs, thank you for your answer.

FYI we also sometimes define the parameters in cclassy.pxd although that's only necessary in some cases, which might not apply here (possibly if you were to use them as derived parameters then classy.pyx would need them defined in cclassy.pxd).

Of course I have defined them both in classy.pyx and cclassy.pxd.

I attach the log.param (as txt).

Maybe the problem is that I defined them also as derived parameters? ipta.param.txt Thank you for the help and tell me if you need something else, the problem is quite strange and I have never had it before. It started only when I add the same parameters also as derived one.

mtagliazucchi commented 11 months ago

Problem solved by removing some wrong modifications that I made