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:

cosmicjellyfish.analysis.fisher_matrix

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:

dict

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:

numpy.ndarray

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:

numpy.ndarray

fisher_calculation(zi, p_i, p_j)[source]#

This helper function calculates a singular element of the fisher matrix

Parameters:
  • zi (int) – index of the redshift bin

  • p_i (str) – name of the first parameter

  • p_j (str) – name of the second parameter

Returns:

The Fisher matrix element computed from the derivative with respect to two parameters and a given redshift bin for a spectroscopic probe

Return type:

float

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:

float

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 bin

  • k (numpy.ndarray) – grid of wavenumbers used in the calculation. Has to be the internal kmesh

  • mu (numpy.ndarray) – grid of observation angles used in the calculation. Has to be the internal mumesh

  • pi (str) – name of the first parameter

  • pj (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:

numpy.ndarray

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 passed

  • covmat (list, optional) – A list of pandas.DataFrame objects that store the covariance matrix for each multipole. Will recompute from lss_obj when not passed

  • derivs (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 passed

  • lss_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:

numpy.ndarray

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 passed

  • covmat (list, optional) – A list of pandas.DataFrame objects that store the covariance matrix for each multipole. Will recompute from lss_obj when not passed

  • derivs (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 passed

  • lss_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:

numpy.ndarray

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 matrix

  • totaltime (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:

cosmicjellyfish.analysis.fisher_matrix

recap_options()[source]#

This will print all the selected options into the standard output