firecrown.likelihood.likelihood.Likelihood#

class firecrown.likelihood.likelihood.Likelihood(parameter_prefix=None)[source]#

Bases: Updatable

Likelihood is an abstract class.

Concrete subclasses represent specific likelihood forms (e.g. gaussian with constant covariance matrix, or Student’s t, etc.).

Concrete subclasses must have an implementation of both read and compute_loglike. Note that abstract subclasses of Likelihood might implement these methods, and provide other abstract methods for their subclasses to implement.

Parameters:

parameter_prefix (None | str) –

Public Methods:

__init__([parameter_prefix])

Default initialization for a base Likelihood object.

read(sacc_data)

Read the covariance matrix for this likelihood from the SACC file.

make_realization_vector()

Create a new realization of the model.

make_realization(sacc_data[, add_noise, strict])

Create a new realization of the model.

compute_loglike(tools)

Compute the log-likelihood of generic CCL data.

Inherited from Updatable

__init__([parameter_prefix])

Updatable initialization.

__setattr__(key, value)

Set the attribute named key to the supplied value.

set_parameter(key, value)

Sets the parameter to the given value.

set_internal_parameter(key, value)

Assure this InternalParameter has not already been set, and then set it.

set_sampler_parameter(value)

Assure this SamplerParameter has not already been set, and then set it.

update(params)

Update self by calling to prepare for the next MCMC sample.

is_updated()

Determine if the object has been updated.

reset()

Reset the updatable.

required_parameters()

Returns a RequiredParameters object.

get_derived_parameters()

Returns a collection of derived parameters.

Private Methods:

Inherited from Updatable

_update(params)

Method for auxiliary updates to be made to an updatable.

_reset()

Abstract method implemented by all concrete classes to update self.

_required_parameters()

Return a RequiredParameters object containing the information for this class.

_get_derived_parameters()

Returns the derived parameters of an implementation.


abstract compute_loglike(tools)[source]#

Compute the log-likelihood of generic CCL data.

Parameters:

tools (ModelingTools) –

Return type:

float

make_realization(sacc_data, add_noise=True, strict=True)[source]#

Create a new realization of the model.

This realization uses the previously computed theory vector and covariance matrix.

Parameters:
  • sacc_data (Sacc) – The SACC data object containing the covariance matrix

  • add_noise (bool) – If True, add noise to the realization. If False, return only the theory vector.

  • strict (bool) – If True, check that the indices of the realization cover all the indices of the SACC data object.

Return type:

Sacc

make_realization_vector()[source]#

Create a new realization of the model.

This new realization uses the previously computed theory vector and covariance matrix.

Return type:

ndarray[Any, dtype[float64]]

abstract read(sacc_data)[source]#

Read the covariance matrix for this likelihood from the SACC file.

Parameters:

sacc_data (Sacc) –

Return type:

None