pybop.costs._likelihoods#

Classes#

BaseLikelihood

Base class for likelihoods

GaussianLogLikelihood

This class represents a Gaussian Log Likelihood, which assumes that the

GaussianLogLikelihoodKnownSigma

This class represents a Gaussian Log Likelihood with a known sigma,

Module Contents#

class pybop.costs._likelihoods.BaseLikelihood(problem, sigma=None)[source]#

Bases: pybop.costs.base_cost.BaseCost

Base class for likelihoods

get_n_parameters()[source]#

Returns the number of parameters

get_sigma()[source]#

Getter for sigma parameter

set_sigma(sigma)[source]#

Setter for sigma parameter

class pybop.costs._likelihoods.GaussianLogLikelihood(problem)[source]#

Bases: BaseLikelihood

This class represents a Gaussian Log Likelihood, which assumes that the data follows a Gaussian distribution and computes the log-likelihood of observed data under this assumption.

_logpi#

Precomputed offset value for the log-likelihood function.

Type:

float

_evaluate(x, grad=None)[source]#

Evaluates the Gaussian log-likelihood for the given parameters.

Parameters:

x (array_like) – The parameters for which to evaluate the log-likelihood. The last self.n_outputs elements are assumed to be the standard deviations of the Gaussian distributions.

Returns:

The log-likelihood value, or -inf if the standard deviations are received as non-positive.

Return type:

float

_evaluateS1(x, grad=None)[source]#

Calls the problem.evaluateS1 method and calculates the log-likelihood

class pybop.costs._likelihoods.GaussianLogLikelihoodKnownSigma(problem, sigma)[source]#

Bases: BaseLikelihood

This class represents a Gaussian Log Likelihood with a known sigma, which assumes that the data follows a Gaussian distribution and computes the log-likelihood of observed data under this assumption.

_logpi#

Precomputed offset value for the log-likelihood function.

Type:

float

_evaluate(x, grad=None)[source]#

Calls the problem.evaluate method and calculates the log-likelihood

_evaluateS1(x, grad=None)[source]#

Calls the problem.evaluateS1 method and calculates the log-likelihood