cosmicfish_pylib.fisher_operationsΒΆ

Module that contains operations that can be performed on Fisher matrices. All of them are safeguarded against non-Fisher input.

eliminate_columns_rows This function eliminates the row and columns corresponding to the given indexes from the Fisher matrix.
eliminate_parameters This function eliminates the row and columns corresponding to the given parameter name from the Fisher matrix.
reshuffle This function reshuffles a Fisher matrix.
marginalise This function marginalises a Fisher matrix over all parameters but the ones in names.
marginalise_over This function marginalises a Fisher matrix over the parameters in names.
cosmicfish_pylib.fisher_operations.eliminate_columns_rows(fisher_matrix, indexes)[source]

This function eliminates the row and columns corresponding to the given indexes from the Fisher matrix. It also deletes all the other informations like the names of the parameters. Notice that the index corresponding to the first parameter is zero.

Parameters:
Returns:

A Fisher matrix with the columns and rows deleted

Return type:

cosmicfish_pylib.fisher_matrix.fisher_matrix

cosmicfish_pylib.fisher_operations.eliminate_parameters(fisher_matrix, names)[source]

This function eliminates the row and columns corresponding to the given parameter name from the Fisher matrix. It also deletes all the other informations like the names of the parameters.

Parameters:
Returns:

A Fisher matrix with the parameters deleted

Return type:

cosmicfish_pylib.fisher_matrix.fisher_matrix

cosmicfish_pylib.fisher_operations.information_gain(fisher_1, fisher_2, fisher_prior, units=0.6931471805599453, stat=True)[source]

This function computes the Fisher approximation of Kullback-Leibler information gain. For the details of the formula we refer to the CosmicFish notes.

Parameters:
Returns:

a float with the information gain.

Return type:

float

cosmicfish_pylib.fisher_operations.marginalise(fisher_matrix, names)[source]

This function marginalises a Fisher matrix over all parameters but the ones in names. The new Fisher matrix will have the parameters specified in names, in the order specified by names. The calculation is performed in the numerically stable way.

Parameters:
  • fisher_matrix (cosmicfish_pylib.fisher_matrix.fisher_matrix) – input Fisher matrix
  • names (list of string) – list of names of the parameters of the output Fisher matrix, in the order that will appear in the output Fisher matrix. All other parameters will be marginalized over.
Returns:

A Fisher matrix with the marginalized parameters

Return type:

cosmicfish_pylib.fisher_matrix.fisher_matrix

cosmicfish_pylib.fisher_operations.marginalise_over(fisher_matrix, names)[source]

This function marginalises a Fisher matrix over the parameters in names. The new Fisher matrix will not have the parameters specified in names. The calculation is performed in the numerically stable way.

Parameters:
Returns:

A Fisher matrix with the names parameters marginalized.

Return type:

cosmicfish_pylib.fisher_matrix.fisher_matrix

cosmicfish_pylib.fisher_operations.reshuffle(fisher_matrix, names)[source]

This function reshuffles a Fisher matrix. The new Fisher matrix will have the parameters specified in names, in the order specified by names. Can be used to delete parameters, change their order or extract the Fisher for some parameters without marginalizing over the others.

Parameters:
Returns:

A Fisher matrix with the new parameters

Return type:

cosmicfish_pylib.fisher_matrix.fisher_matrix