FisherMatrix#
- class cosmicjellyfish.fishermatrix.cosmicfish.FisherMatrix(options={}, specifications={}, observables=None, freepars=None, extfiles=None, fiducialpars=None, photobiaspars=None, photopars=None, spectrononlinearpars=None, spectrobiaspars=None, IApars=None, IMbiaspars=None, PShotpars=None, surveyName='Euclid', cosmoModel='w0waCDM', latexnames=None, derivative_provider=None)[source]#
Bases:
object- compute(max_z_bins=None)[source]#
This function will compute the Fisher information matrix and export using the specified settings.
- Parameters:
max_z_bins (
int) – For the spectroscopic probe what the highest redshift bin that should be considered in the computation of the Fisher- Returns:
A instance of fisher_matrix containing the calculated Fisher matrix as well as parameter names, settings, etc
- Return type:
- set_pk_settings()[source]#
Function to define grids of the internal wavenumber and observation angle
Note
This is not a setter function. Rather the internal grids are constructed from the passed options and then they are stored in the attributes Pk_kgrid and Pk_mugrid as well as the combined meshes Pk_kmesh and Pk_mumesh.
- compute_binned_derivs(z_arr)[source]#
This computes the derivatives of the observed power spectrum for all redshift bins
- Parameters:
z_arr (
list,numpy.ndarray) – List of the redshift bin centers of the probe- Returns:
A dictionary containing lists of derivatives of the observed power spectrum for each redshift bin and varied parameter
- Return type:
- pk_LSS_Fisher(nbins)[source]#
This computes the Fisher matrix of a spectroscopic probe for all redshift bins
- Parameters:
nbins (
int) – number of redshift bins the spectroscopic probe has- Returns:
A list of Fisher matrices for each redshift bin
- Return type:
- fisher_per_bin(ibin)[source]#
This helper function contains the Fisher matrix of a spectroscopic probe for a single redshift bin
- Parameters:
ibin (
int) – index of the redshift bin- Returns:
Fisher matrix of a spectroscopic probe for a single redshift bin
- Return type:
- fisher_calculation(zi, p_i, p_j)[source]#
This helper function calculates a singular element of the fisher matrix
- fisher_integral(integrand)[source]#
Function to calculate the integral that enters the computation of the Fisher elements. Uses a simpson integration on the mu and k grid
- Parameters:
integrand (
numpy.ndarray) – Integrant that enters the Fisher matrix element computation. The shape needs to match ( shape of the kmesh ) x ( shape of mumesh)- Returns:
The Fisher matrix element computed from the derivative with respect to two parameters at a given redshift bin for a spectroscopic probe
- Return type:
- fish_integrand(zi, k, mu, pi, pj)[source]#
Helper function to calculate the integrand that enters the computation of the Fisher elements.
- Parameters:
zi (
int) – index of the redshift bink (
numpy.ndarray) – grid of wavenumbers used in the calculation. Has to be the internal kmeshmu (
numpy.ndarray) – grid of observation angles used in the calculation. Has to be the internal mumeshpi (
str) – name of the first parameterpj (
str) – name of the second parameter
- Returns:
Integrant that enters the Fisher matrix element computation. The shape matches ( shape of the kmesh ) x ( shape of mumesh)
- Return type:
- photo_LSS_fishermatrix(noisy_cls=None, covmat=None, derivs=None, lss_obj=None)[source]#
Compute the Fisher matrix of a photometric probe.
- Parameters:
noisy_cls (
dict, optional) – a dictionary with all the auto and cross correlation fiducial angular power spectra with noise added to it. Will recompute from lss_obj when not passedcovmat (
list, optional) – A list of pandas.DataFrame objects that store the covariance matrix for each multipole. Will recompute from lss_obj when not passedderivs (
dict, optional) – A dictionary containing the derivatives of the angular power spectrum at the fiducial for all free parameters. Will recompute from lss_obj when not passedlss_obj (
cosmicjellyfish.LSSsurvey.photo_cov.PhotoCov, optional) – This object is used to compute the ingredients of the Fisher matrix if they were not passed
- Returns:
The full fisher matrix for the photometric probe
- Return type:
- photo_LSS_fishermatrix_einsum(noisy_cls=None, covmat=None, derivs=None, lss_obj=None)[source]#
Compute the Fisher matrix of a photometric probe.
- Parameters:
noisy_cls (
dict, optional) – a dictionary with all the auto and cross correlation fiducial angular power spectra with noise added to it. Will recompute from lss_obj when not passedcovmat (
list, optional) – A list of pandas.DataFrame objects that store the covariance matrix for each multipole. Will recompute from lss_obj when not passedderivs (
dict, optional) – A dictionary containing the derivatives of the angular power spectrum at the fiducial for all free parameters. Will recompute from lss_obj when not passedlss_obj (
cosmicjellyfish.LSSsurvey.photo_cov.PhotoCov, optional) – This object is used to compute the ingredients of the Fisher matrix if they were not passed
- Returns:
The full fisher matrix for the photometric probe
- Return type:
- eliminate_zbinned_freepars(nmax)[source]#
This helper function is there to find any parameters passed that correspond to no zbin. It will then remove them from the varied parameters list
- Parameters:
nmax (
int) – Index of the highest redshift bin that should be considered
- export_fisher(fishmat, totaltime=None)[source]#
Will print the fisher matrix as well as specifications and the parameter names to files. To change location and filenames for this check the settings dictionary of cosmicjellyfish.configs.config
- Parameters:
fishmat (
numpy.ndarray) – Computed Fisher matrixtotaltime (
float, optional) – Total time needed to compute the fisher. Will print time information if passed
- Returns:
A instance of fisher_matrix containing the calculated Fisher matrix as well as parameter names, settings, etc
- Return type: