redback.likelihoods.GaussianLikelihoodUniformXErrors

class redback.likelihoods.GaussianLikelihoodUniformXErrors(*args: Any, **kwargs: Any)[source]

Bases: GaussianLikelihood

__init__(x: ndarray, y: ndarray, sigma: Union[float, None, ndarray], bin_size: Union[float, None, ndarray], function: callable, kwargs: Optional[dict] = None) None[source]

A general Gaussian likelihood with uniform errors in x- the parameters are inferred from the arguments of function. Takes into account the X errors with a Uniform likelihood between the bin high and bin low values. Note that the prior for the true x values must be uniform in this range!

Parameters:
  • x (np.ndarray) – The x values.

  • y (np.ndarray) – The y values.

  • sigma (Union[float, None, np.ndarray]) – The standard deviation of the noise.

  • bin_size (Union[float, None, np.ndarray]) – The bin sizes.

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

  • kwargs (dict) – Any additional keywords for ‘function’.

__call__(*args: Any, **kwargs: Any) Any

Call self as a function.

Methods

__init__(x, y, sigma, bin_size, function[, ...])

A general Gaussian likelihood with uniform errors in x- the parameters are inferred from the arguments of function.

log_likelihood()

return:

The log-likelihood.

log_likelihood_x()

return:

The log-likelihood due to x-errors.

log_likelihood_y()

return:

The log-likelihood due to y-errors.

noise_log_likelihood()

return:

The noise log-likelihood, i.e. the log-likelihood assuming the signal is just noise.

Attributes

kwargs

n

Length of the x/y-values :rtype: int

residual

sigma

log_likelihood() float[source]
Returns:

The log-likelihood.

Return type:

float

log_likelihood_x() float[source]
Returns:

The log-likelihood due to x-errors.

Return type:

float

log_likelihood_y() float[source]
Returns:

The log-likelihood due to y-errors.

Return type:

float

property n: int

Length of the x/y-values :rtype: int

Type:

return

noise_log_likelihood() float[source]
Returns:

The noise log-likelihood, i.e. the log-likelihood assuming the signal is just noise.

Return type:

float