:py:mod:`flip.likelihood` ========================= .. py:module:: flip.likelihood Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: flip.likelihood.BaseLikelihood flip.likelihood.MultivariateGaussianLikelihood flip.likelihood.MultivariateGaussianLikelihoodInterpolate1D flip.likelihood.MultivariateGaussianLikelihoodInterpolate2D Functions ~~~~~~~~~ .. autoapisummary:: flip.likelihood.log_likelihood_gaussian_inverse flip.likelihood.log_likelihood_gaussian_cholesky Attributes ~~~~~~~~~~ .. autoapisummary:: flip.likelihood.log .. py:data:: log .. py:function:: log_likelihood_gaussian_inverse(vector, covariance_sum) .. py:function:: log_likelihood_gaussian_cholesky(vector, covariance_sum) .. py:class:: BaseLikelihood(covariance=None, data=None, parameter_names=None, likelihood_properties={}) Bases: :py:obj:`object` .. py:attribute:: _default_likelihood_properties .. py:method:: init_from_covariance(covariance, data, parameter_names, likelihood_properties={}, **kwargs) :classmethod: The init_from_covariance function is a class method that initializes the likelihood object from a covariance matrix. :param cls: Create a new instance of the class :param covariance: Compute the full matrix of the covariance :param parameter_names: Set the names of the parameters :param density: Compute the vector and its error :param density_err: Compute the vector_err :param velocity: Compute the vector and vector_err :param velocity_err: Compute the error in the vector :param : Compute the vector :returns: A likelihood object .. py:method:: load_data_vector(model_type, parameter_values_dict) .. py:class:: MultivariateGaussianLikelihood(covariance=None, data=None, parameter_names=None, likelihood_properties={}) Bases: :py:obj:`BaseLikelihood` .. py:method:: verify_covariance() .. py:method:: __call__(parameter_values) .. py:class:: MultivariateGaussianLikelihoodInterpolate1D(covariance=None, data=None, parameter_names=None, likelihood_properties={}, interpolation_value_name=None, interpolation_value_range=None) Bases: :py:obj:`BaseLikelihood` .. py:method:: verify_covariance() The verify_covariance function is used to ensure that the covariance matrix of each parameter in the model has been computed. If it has not, then this function will compute it and store it as a full matrix. :param self: Bind the method to the object :returns: Nothing .. py:method:: __call__(parameter_values) 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. :param self: Refer to the object itself :param parameter_values: Pass the values of the parameters to be used in this evaluation :param interpolation_value: Interpolate the covariance_sum :returns: The log likelihood value of the data vector given a set of parameters and an interpolation value .. py:class:: MultivariateGaussianLikelihoodInterpolate2D(covariance=None, data=None, parameter_names=None, likelihood_properties={}, interpolation_value_range_0=None, interpolation_value_range_1=None) Bases: :py:obj:`BaseLikelihood` .. py:method:: verify_covariance() .. py:method:: __call__(parameter_values, interpolation_value_0, interpolation_value_1) 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! :param self: Refer to the object itself :param parameter_values: Compute the covariance matrix :param interpolation_value_0: Interpolate the covariance matrix along the first dimension :param interpolation_value_1: Interpolate the covariance matrix :param : Compute the covariance sum :returns: The log-likelihood function