Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting precision? #156

Open
hezi-zhang opened this issue May 28, 2017 · 6 comments
Open

Setting precision? #156

hezi-zhang opened this issue May 28, 2017 · 6 comments

Comments

@hezi-zhang
Copy link

hezi-zhang commented May 28, 2017

Hi,

As I need to take derivative of Cl's, I found that there is a lot of noise and the curve is not smooth. Although I tried fitting them, the result seems to depend on how dense the sampling is. So I wonder why there is so much noise on the curves of Cl's and whether I can enhance the precision to get rid of it. If so, how can I change the precision? I saw that there are some precision files, but they contain so much parameters that I can not figure out which to change.

Thank you,
Hezi

@ThomasTram
Copy link
Collaborator

Hi Hexi

The two relevant parameters are

l_logstep = 1.12
l_linstep = 40

where I have shown the default values. The Cl's are computed from a cubic spline, so the first derivatives are guaranteed to be continuous (but not smooth).

Cheers,
Thomas

@lesgourg
Copy link
Owner

Hi Hexi,
The default precision is tuned for the needs of MCMC parameter extraction, which work well with low precision. Taking derivatives with respect to l or with respect to Cosmo parameters (for Fisher , or for gradient methods of minimisation) indeed requires better precision. Please say a bit more on the kind of derivatives you are computing (wrt l or parameters?) and I can provide you a small subset of relevant precision parameters.

@BryanSagredo
Copy link

Hello Class team, I'm in similar trouble adjusting the precision parameters.

I'm doing a Fisher forecast using the galaxy power spectrum and I'd like to increase the amount of k-points used for the interpolation (using classy Python wrapper) to take better derivatives wrt cosmological parameters.

Thank you in advance!
Cheers,

Bryan

@lesgourg
Copy link
Owner

lesgourg commented Aug 1, 2017

Hi there,
Let me first give below a set of precision parameters that I trust for lowering considerably the 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

But the question of Bryan was more specific. Bryan I think that you should play with two parameters fixed by default to

k_per_decade_for_pk = 10
k_per_decade_for_bao = 70

controlling respectively the sampling in the BAO region and in the rest. You could increase both to a common high number, e.g. 100 or 400...

@lesgourg
Copy link
Owner

lesgourg commented Aug 1, 2017

PS in the last post I forgot the _ in

reionization_optical_depth_tol = 1.e-5

@BryanSagredo
Copy link

Thank you very much! So far it's working like a charm.

Also, increasing the last two parameters makes the derivatives even more stable.

Cheers,
Bryan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants