flip.likelihood#

Module Contents#

Classes#

Functions#

log_likelihood_gaussian_inverse(vector, covariance_sum)

log_likelihood_gaussian_cholesky(vector, covariance_sum)

Attributes#

log

flip.likelihood.log#
flip.likelihood.log_likelihood_gaussian_inverse(vector, covariance_sum)[source]#
flip.likelihood.log_likelihood_gaussian_cholesky(vector, covariance_sum)[source]#
class flip.likelihood.BaseLikelihood(covariance=None, data=None, parameter_names=None, likelihood_properties={})[source]#

Bases: object

_default_likelihood_properties#
classmethod init_from_covariance(covariance, data, parameter_names, likelihood_properties={}, **kwargs)[source]#

The init_from_covariance function is a class method that initializes the likelihood object from a covariance matrix.

Parameters:
  • cls – Create a new instance of the class

  • covariance – Compute the full matrix of the covariance

  • parameter_names – Set the names of the parameters

  • density – Compute the vector and its error

  • density_err – Compute the vector_err

  • velocity – Compute the vector and vector_err

  • velocity_err – Compute the error in the vector

:param : Compute the vector

Returns:

A likelihood object

load_data_vector(model_type, parameter_values_dict)[source]#
class flip.likelihood.MultivariateGaussianLikelihood(covariance=None, data=None, parameter_names=None, likelihood_properties={}, negloglik=False)[source]#

Bases: BaseLikelihood

_default_likelihood_properties#
verify_covariance()[source]#
__call__(parameter_values)[source]#
class flip.likelihood.MultivariateGaussianLikelihoodInterpolate1D(covariance=None, data=None, parameter_names=None, likelihood_properties={}, interpolation_value_name=None, interpolation_value_range=None)[source]#

Bases: BaseLikelihood

verify_covariance()[source]#
__call__(parameter_values)[source]#

The __call__ function is the function that is called when you call an instance of a class. For example, if you have a class named ‘Foo’ and create an instance of it like this:

foo = Foo()

then calling foo(x) will actually run the __call__ function in your Foo class with x as its argument.

Parameters:
  • self – Refer to the object itself

  • parameter_values – Pass the values of the parameters to be used in this evaluation

  • interpolation_value – Interpolate the covariance_sum

Returns:

The log likelihood value of the data vector given a set of parameters and an interpolation value

class flip.likelihood.MultivariateGaussianLikelihoodInterpolate2D(covariance=None, data=None, parameter_names=None, likelihood_properties={}, interpolation_value_range_0=None, interpolation_value_range_1=None)[source]#

Bases: BaseLikelihood

verify_covariance()[source]#
__call__(parameter_values, interpolation_value_0, interpolation_value_1)[source]#

The __call__ function is the function that will be called when the likelihood object is called. It takes in a list of parameter values, and returns a float value representing the log-likelihood value for those parameters. The __call__ method should not be overwritten by subclasses unless you know what you are doing!

Parameters:
  • self – Refer to the object itself

  • parameter_values – Compute the covariance matrix

  • interpolation_value_0 – Interpolate the covariance matrix along the first dimension

  • interpolation_value_1 – Interpolate the covariance matrix

:param : Compute the covariance sum

Returns:

The log-likelihood function