bilby.core.likelihood.GaussianLikelihood

class bilby.core.likelihood.GaussianLikelihood(x, y, func, sigma=None, **kwargs)[source]

Bases: Analytical1DLikelihood

__init__(x, y, func, sigma=None, **kwargs)[source]

A general Gaussian likelihood for known or unknown noise - the model parameters are inferred from the arguments of function

Parameters:
x, y: array_like

The data to analyse

func:

The python function to fit to the data. Note, this must take the dependent variable as its first argument. The other arguments will require a prior and will be sampled over (unless a fixed value is given).

sigma: None, float, array_like

If None, the standard deviation of the noise is unknown and will be estimated (note: this requires a prior to be given for sigma). If not None, this defines the standard-deviation of the data points. This can either be a single float, or an array with length equal to that for x and y.

__call__(*args, **kwargs)

Call self as a function.

Methods

__init__(x, y, func[, sigma])

A general Gaussian likelihood for known or unknown noise - the model parameters are inferred from the arguments of function

log_likelihood()

Returns:

log_likelihood_ratio()

Difference between log likelihood and noise log likelihood

noise_log_likelihood()

Returns:

Attributes

func

Make func read-only

function_keys

Makes function_keys read_only

marginalized_parameters

meta_data

model_parameters

This sets up the function only parameters (i.e. not sigma for the GaussianLikelihood) .

n

The number of data points

residual

Residual of the function against the data.

sigma

This checks if sigma has been set in parameters.

x

The independent variable.

y

The dependent variable.

property func

Make func read-only

property function_keys

Makes function_keys read_only

log_likelihood()[source]
Returns:
float
log_likelihood_ratio()[source]

Difference between log likelihood and noise log likelihood

Returns:
float
property model_parameters

This sets up the function only parameters (i.e. not sigma for the GaussianLikelihood)

property n

The number of data points

noise_log_likelihood()[source]
Returns:
float
property residual

Residual of the function against the data.

property sigma

This checks if sigma has been set in parameters. If so, that value will be used. Otherwise, the attribute sigma is used. The logic is that if sigma is not in parameters the attribute is used which was given at init (i.e. the known sigma as either a float or array).

property x

The independent variable. Setter assures that single numbers will be converted to arrays internally

property y

The dependent variable. Setter assures that single numbers will be converted to arrays internally