Open fhenryco opened 3 years ago
Dear Frederic, this is indeed totally expected. CLASS can work at many different precision levels, and of course precision has a cost in terms of CPU time, so we always try to set the default precision to something fast, with just enough precision for the needs of most users. Most users do Bayesian inference with MCMC chains. For this, a relatively low precision is sufficient. Thus CLASS (and actually also CAMB) have default precision settings adjusted for those users. But it is very easy to increase the precision in roder to do profile likelihoods, frequentist analyses and minimisation with MINUIT. For instance, the CAMEL team (a sub-team of Planck specialised on frequentists analyses and based in Orsay) did a massive use of CLASS with MINUIT, always with enhanced precision settings (that still keep the code relatively fast - I think the slow down is of the order of 50% at most). You might find these settings written in their papers. I am also sure that there is one issue dedicated to this on forum, with some clear recommendation for the precision settings. I will try to dig it out and come back to you.
Indeed this has been touched at least in #156. Quoting from there:
Let me give below a set of precision parameters that I trust for lowering considerably the numerical noise. It has been used in the paper https://arxiv.org/pdf/1311.1657.pdf which performed a frequentist analysis and had to use a high-precision minimisation algorithm instead of an MCMC. As stated in their Table 1, they found that they should use:
tol_background_integration = 1.e-3
tol_thermo_integration = 1.e-3
tol_perturb_integration = 1.e-6
reionization optical depth tol = 1.e-5
l_logstep = 1.08
l_linstep = 25
perturb_sampling_stepsize = 0.04
delta_l_max = 800
Since this dates back from 2013, a few things may have change. Please let us know if you find that these settings are not sufficient (or on the contrary, that you can get the precision you want with less extreme settings). Note that the meaning of tol_background_integration and tol_thermo_integration will become different in the forthcoming CLASS v3.0 release, thus these parameters will take different values (in the default and in the high-precision settings). Then we will try to remember to update this chat!
Thank you very much for your reactivity and this set of precision parameters. I actually had tried to modify some of the parameters in precision.h but apparently not the best ones...thanks again
No need to change any .h and recompile... just pass your precisions parameters in input as you would do with the cosmological parameters!
OK , Minuit works much better now, thanks!
hello,
Minuit fails to give me the parameter error on Omega_M when i fit a TT power spectrum simulated with Class. The Chi2 parabola as function of this parameter (all other parameters being fixed) is not smooth which is probably the reason why minuit fails.
is such chaotic shape of the parabola actually expected with Class due limited precision of computations( rounding noises) ? Do other people see this ? When i try to minimize versus other parameters such as As or ns the parabola is on the other hand perfecly smooth and minuit succeedes!