Power spectrum recovery¶
Gaussian and lognormal fields¶
We begin by testing the consistency of our Gaussian and lognormal maps generation pipeline.
Figure 9:Comparison of a Gaussian map, on the left, with a lognormal map on the right. Both maps arise from the same random seed. The colorbar has been adjusted to enhance the differences between the two. The histogram plot shows the clear difference in the map distributions.
We show example realisations of the two fields in Fig. 9, Gaussian on left and lognormal on the right. There’s a visible difference between the two, as it can be seen clearly from the distribution plot. The main check to perform is for testing whether the generated fields recover the theoretical power spectrum. Fig. 10 shows that this is the case for the Gaussian fields. They recover the fiducial within a few percent error, with larger deviations at the low and high ends of the -range. Instead, lognormal fields present deviations . As the lognormal transformations we use have been reported by different sources Zhou et al. (2023)Boruah et al. (2022), the issue must lie with our JAX implementation of the Hankel transformation. Resolving such issues could be achieved by future iterations of this work. In this work, we restrict ourselves to the use of Gaussian fields, as it is enough to prove our thesis and show that Gaussian processes can be applied to cosmological fields.
Figure 10:Power spectrum estimation from Gaussian and lognormal maps. Mean and standard deviation are calculated with 500 realisation of both fields.
Gaussian process priors¶
First, we test the ability of the kernels we have built in Sec. ?? to recover the power spectrum of our cosmology.
Figure 11:Reconstructed power spectrum from prior sample of GP with the four proposed kernels: integration, FFTlog, full-range FFT, half-range FFT and sinc FFTlog. Mean and standard deviation are calculated with 500 prior samples from each GP.
We test five models in Fig. 11: integration, FFTlog, full-range FFT, half-range FFT and sinc FFTlog. The first four methods are described in the Gaussian process kernels Sec. ??, whereas the sinc FFTlog referes to a FFTlog model on which we applied smoothing, by multiplying the power spectrum by a factor of . The recovered power spectra are plotted against the fiducial power spectrum, or smoothed power spectrum for the sinc FFTlog. Mean and standard deviation associated to the plots are calculated from 500 samples. As expected the integration, FFTlog and full-range FFT perform similarly, as they all contain the same ammount of information. As these models deviate so strongly from the fiducial power spectrum we tried applying smoothing, which helps to recover half of the -range at large scales. The only method that seems to be consistently recovering the fiducial power spectrum is the half-range FFT. One could argue that due to the inherent discreteness and boundedness of the fields we are working with, using FFTs is the most natural choice; also, half-range FFT uses the only grid that recovers a correlation function of the same shape as the field without having to perform binning.
Figure 12:Reconstructed power spectrum from prior samples of a GP, as a function of . Mean and standard deviation are calculated with 500 prior samples for each different cosmology.
We have also tested the efficacy of the half-range FFT model for different cosmologies of values equal to , and, our fiducial cosmology, . As Fig. 12 shows, the model is independent of the choice of cosmology. From here on the results will be presented assuming a kernel built with the half-range FFT model.
Gaussian process map reconstruction¶
Armed with a reliable kernel, let’s embark upon the journey of reconstructing a heavily masked cosmological field. What we will do is: create a noiseless GRF in the fiducial cosmology Tab. %s, True map; apply a mask to obtain the Data map; condition a Gaussian process which assumes the fiducial cosmology. Fig. 13 lists the result of this operation, showing the resulting mean and standard deviation of the conditioned GP. We also plot the ratio between residuals True and standard deviation squared, to test the goodness of fit of our model, the values of the map sum up to . With the mask covering pixels, we obtain . Of course, this is just a noiseless application, which is unreasonable for a real application.
Figure 13:Summary of field reconstruction abilities of a Gaussian process conditioned on data. The left column shows the masked GRF, which is our data. The middle column shows the true GRF without masks and a posterior sample drawn from the conditioned GP. The right column shows maps of the mean, standard deviation and residuals over standard deviation squared of the conditioned GP. Regions of higher uncertainty correspond to the masked regions. The residuals over standard deviation map also shows how regions with low mask recover the data.
Inference of cosmological parameters¶
To test the ability of Gaussian processes to recover cosmological parameters without any prior knowledge except a noisy and masked map, we perform a MCMC simulation to infer the posterior distributions of and . We use the convention
to infer deterministically a posterior for . Such a reparametrisation is needed due to the strong degeneracy between and . Eq. (30) breaks this degeneracy, changing the geometry of the sampling space and making the sampling more consistent. The model assumes uninformed flat priors for the cosmological parameters, as shown in Tab. %s, such prior bounds are also in accordance with the jaxcosmo release Campagne et al. (2023). The likelihood of the model is given by a Gaussian process distribution conditioned on Data, with a standard deviation equal to the noise applied to the map. The analysis is coded with numpyro Phan et al. (2019) Bingham et al. (2019), using a the No-U-Turn Sampler (NUTS) method with max_tree_depth=16, target_accept_prob=0.8. We simulate 8 chains for the grid and 4 chains for the . Each chain performs 1000 warmup steps and 3000 samples.
One parameter¶
As a first step and for a consistency check, we run the inference model for one cosmological parameter, keeping all others fixed. Using a grid with . In Fig. 15 we show the inferred distribution for both and . We find that we are able to recover the true value for both parameters within two sigmas, and . We notice a slight tendency of the inferred distribution to be biased low; a tendency we also observe next for both sampled parameters, and .
Figure 15:Inferred posterior distribution of on the left and on the right. Dotted lines indicate the level. Truth values corresponding to the fiducial cosmology are indicated in blue.
Two parameters¶
Effect of noise¶
Table 1:List of inferred cosmological parameters inferred by the model with a small grid and for a fixed true GRF realisation. We present the cosmological parameters inferred as we increase the noise level, corresponding to , 10, 30 and .
| 0.0069 | 0.0044 | 0.0025 | 0.0014 | |
We perform some tests on low resolution grids to see the effect that the noise level has on the recovered parameters, see Tab. 1. Here we report the inferred cosmological parameters for one data realisation and different noise levels, corresponding respectively to , 10, 30 and , see Eq. (22). The inferred value of can vary as much as a full between high and low noise runs. Keeping in mind that and are extremely unreliable due to relative uncertainties of caused by the degeneracy: as a general trend we notice gets bigger when gets smaller with less noise.
Inferred cosmological parameters¶
Running the model for a larger grid with , gives much better constraints on the cosmological parameters. We present the values recovered by the posterior distributions, listed as follows in Tab. 2.
Table 2:Mean and sigma values recovered from the inferred distributions of the cosmological parameters.
Fig. 16 shows the inferred posterior distributions and contours for the three cosmological parameters , and . Looking at the contours, we obtain the well known banana-shaped degeneracy between and . The and contour presents sharp cuts for high and low , indicating an issue with the bounds of the uniform priors imposed. Unfortunately the jaxcosmo package does not allow for the choice of priors to be wider than what shown in Tab. %s, as the model then starts to have divergent samples.
Figure 16:Inferred posterior distributions of , and . For noise level . Contours indicate the and credible interval respectively. Dotted lines indicate the level. Truth values corresponding to the fiducial cosmology are indicated in blue.
Posterior checks¶
Following the two parameter inference model, we perform some posterior checks at the map level Porqueres et al. (2021). Fig. 18 sums up the ability of the model to recover the true map, noiseless and unmasked. Here we present the run with noise level and a grid. We show the mean and standard deviation for the sample with highest likelihood out of the 12000. The mean field is visibly different to the true field in the masked regions and it seems to be of overall lower amplitude. The sample map is comparable to the noisy data; which is to be expected, as the internal noise given to the Gaussian process is the same as the noise level of the data. The standard deviation map presents an overall amplitude comparable to the noise level , with higher values for the masked regions. Summing up the map values of the residuals divided by standard deviation squared, we obtain a . Compared to the number of free parameters in our inference model, which for a mask and a grid, is . The value of therefore seems to be low, indicating that the noise level assumed by the GP is overestimated. This is supported by the fact that the sample map looks just as noisy as the data, according to Fig. 17, its distribution is in fact just as wide as the noise.
Figure 17:Residual distributions of the mean and sample compared to noise. The mean is less spread, whereas the sample is wider.
Residuals
Figure 18:Summary of the two parameter inference at the map level. The left column shows the masked and noisy GRF realisation used, which is our data. The middle column shows the true GRF and a sample from the conditioned GP. The right column shows maps of the mean, standard deviation and residuals over standard deviation squared resulting from the numpyro model sample with highest likelihood. Regions of higher uncertainty correspond to the masked regions.
- Zhou, A. J., Li, X., Dodelson, S., & Mandelbaum, R. (2023). Accurate field-level weak lensing inference for precision cosmology.
- Boruah, S. S., Rozo, E., & Fiedorowicz, P. (2022). Map-based cosmology inference with lognormal cosmic shear maps.
- Campagne, J.-E., Lanusse, F., Zuntz, J., Boucaud, A., Casas, S., Karamanis, M., Kirkby, D., Lanzieri, D., Peel, A., & Li, Y. (2023). JAX-COSMO: An End-to-End Differentiable and GPU Accelerated Cosmology Library. The Open Journal of Astrophysics, 6. 10.21105/astro.2302.05163
- Phan, D., Pradhan, N., & Jankowiak, M. (2019). Composable Effects for Flexible and Accelerated Probabilistic Programming in NumPyro. arXiv E-Prints, arXiv:1912.11554. 10.48550/arXiv.1912.11554
- Bingham, E., Chen, J. P., Jankowiak, M., Obermeyer, F., Pradhan, N., Karaletsos, T., Singh, R., Szerlip, P. A., Horsfall, P., & Goodman, N. D. (2019). Pyro: Deep Universal Probabilistic Programming. J. Mach. Learn. Res., 20, 28:1-28:6. http://jmlr.org/papers/v20/18-403.html
- Porqueres, N., Heavens, A., Mortlock, D., & Lavaux, G. (2021). Bayesian forward modelling of cosmic shear data. Monthly Notices of the Royal Astronomical Society, 502(2), 3035–3044. 10.1093/mnras/stab204