Inconsistencies in Theoretical Predictions Arising from Integration and Interpolation Methods in CCL #406
Replies: 14 comments 24 replies
-
Hi there - I have recently encountered a similar issue. I am using CCL to generate 3x2pt data vectors and test the sensitivity of cosmology to different photo-z parameters. The issue that threw me off is when my n(z) distribution is shifted, the cosmological bias jumps up and down at some threshold, see figure for an example below: After some brief investigation, I realized the problem only occurs when I am adding outliers to my n(z). The problem seems to go away when I am using a simple Gaussian n(z), though I have no idea where is the culprit. Investigating this would be really helpful, thank you!! Also happy to provide more details about my case if needed. TQ |
Beta Was this translation helpful? Give feedback.
-
Many thanks for reporting this! I think other folk have more examples so it would be great if we can collectively figure this out and solve it. |
Beta Was this translation helpful? Give feedback.
-
@ztq1996 so basically your problem goes away after you smooth things out? it definitly smells like the problem we think it is causing this -- the interpolation in ccl. |
Beta Was this translation helpful? Give feedback.
-
Sharing here what I commented in today's MCP telecon: could it be that by increasing the binning of your N(z) by a lot, they become noisy? (This is just a guess based on @nikosarcevic presentation) |
Beta Was this translation helpful? Give feedback.
-
Have you plotted the C_ells themselves? My guess is that there is some numerical instability there, and this is what causes the issue. It'd be good to look at those first to find a solution. |
Beta Was this translation helpful? Give feedback.
-
Hi all, @fjaviersanchez @damonge et al sorry for waiting, I had to eat I quickly made a C_ell comparison for different z resolutions. I only checked one cross and one auto correlations: tomo bins (0,1) and (0,0) Here are the results: we see the spikes. it is small but maybe significant overall? |
Beta Was this translation helpful? Give feedback.
-
Yes, those look terrible. It'd be good if you can plot:
|
Beta Was this translation helpful? Give feedback.
-
haha, on it already! working on N(z) atm, will add kernel as well |
Beta Was this translation helpful? Give feedback.
-
@damonge et al. here it is (sorry, i couldnt do it sooner) getting kernels from sources (tracers) in bin 1 and 2 (low) and bins 4 and 5 (high z). seems that things are much worse at low z which is a concern. N(z) is fine (comes from my code, modified version of it is on cclx) also, @paulrogozenski has been kind enough and joined the effort. he is also investigating this and will report (I think) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@ztq1996 woudl you be so kind and maybe give us a bit more clarification and description of your problem? ;grateful: |
Beta Was this translation helpful? Give feedback.
-
Hi, everyone! Some time ago, I was computing some auto angular power spectra and cross angular power spectra for galaxies, using the bin1_histo.txt and bin2_histo.txt dndz's, which can be found here. I was comparing the results from CCL and NumCosmo. In the case of CCL2 cosmology, using the bin1_histo distribution and computing the auto angular power spectrum, I end up with some problematic points. For l = [ 519 586 730 798 931 1063 1147 1148 1189 1190], the accuracy value was above the expected limit of 0.1. In a further investigation, I found that the Cls as computed by NumCosmo are actually smooth in these regions, while the Cls as computed by CCL have some strange fluctuations. We also think this may have something to do with the interpolation and integration methods used in CCL. |
Beta Was this translation helpful? Give feedback.
-
Apologies for the slow response. I do see differences, but in my case it's because the way I am generating the dndz itself depends on the the sampling that I do in dndz. The first plot is the relative difference in C_ells and the second plot it's the absolute difference in the dndz. And the code:
I'll try with some other dndz more numerically stable :) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hello, awesome people!
I've encountered a significant challenge related to the integration stability in the Core Cosmology Library (CCL) which I believe warrants our attention. This issue primarily concerns the discrepancies in theoretical predictions due to varying resolutions of redshifts, particularly observable through different outcomes in Fisher analysis and potentially affecting MCMC 2-point function analyses.
Problem Description
In my recent work, I've observed that changing the resolution over which the redshifts (N(z)) are defined leads to noticeable differences in Fisher contour predictions. Specifically, the differences emerge when (N(z)) is defined over the range (0 < z < 4) with varying resolutions, as illustrated by the following scenarios:
For each resolution, I generated redshift arrays using
np.linspace(0, 4, resolution)
, and subsequently ran Fisher analyses (using FISK, my Fisher analysis pipeline). The resulting contours differed significantly across the resolutions, including changes in direction which suggests a deeper underlying issue.I have solved it by migrating to a different derivative method (not using the finite difference method but using the "stem" method -- see this repository for explanation).
However, it is still crucial to determine what is causing the inconsistencies.
To showcase this problem, I am including the Fisher contours for LSST Y1 and Y10 from FISK, using different resolutions of the redshift range. Note that the benchmark (in solid black line) is the previous SRD result.
We can see that, depending on the chosen resolution of the redshift range, the resulting contours will greatly differ. This is a very serious problem because it is impossible to gauge which result is the "true" one, even in case we have a benchmark to compare to.
Suspected Cause
My investigations lead me to believe that the issue may stem from a combination of numerical integration and interpolation strategies used within CCL, particularly those involving GSL integration methods and fallback routines. When certain methods fail or yield unstable results, CCL seems to switch to alternative strategies. While this ensures that a result is always produced, it might lead to unphysical outcomes due to inconsistencies in the integration or interpolation approach adopted. Integration, interpolation, and normalisation is used throughout CCL and I believe it is important to inspect and investigate the cause.
Impact
This problem is not just limited to Fisher analysis but extends to any computation relying on consistent theoretical predictions from CCL, such as MCMC analyses using 2-point functions, or any future anlyses from DESC. Inconsistent integration or interpolation methods could compromise the reliability of our results, making it imperative to address this issue.
Proposed Solution
To mitigate these discrepancies and ensure the robustness of CCL's theoretical predictions, I propose a thorough review and potential overhaul of the integration and interpolation methods used within the library. This could involve:
I believe addressing this issue is crucial for the integrity of research utilizing CCL. I welcome any insights, suggestions, or collaborative efforts from the community to tackle this challenge together.
I look forward to your feedback and any further discussions on how we can improve CCL's reliability and accuracy.
If you encounter(ed) similar problems, please let me know and we can work on this together, write a report and solve this problem.
Best,
Niko
P.S. Let me know if there are typos or untrue statements in my post.
Beta Was this translation helpful? Give feedback.
All reactions