bilby.core.likelihood.PoissonLikelihood
- class bilby.core.likelihood.PoissonLikelihood(x, y, func, **kwargs)[source]
Bases:
Analytical1DLikelihood- __init__(x, y, func, **kwargs)[source]
A general Poisson likelihood for a rate - the model parameters are inferred from the arguments of function, which provides a rate.
- Parameters:
- x: array_like
A dependent variable at which the Poisson rates will be calculated
- y: array_like
The data to analyse - this must be a set of non-negative integers, each being the number of events within some interval.
- func:
The python function providing the rate of events per interval to fit to the data. The function must be defined with the first argument being a dependent parameter (although this does not have to be used by the function if not required). The subsequent arguments will require priors and will be sampled over (unless a fixed value is given).
- __call__(*args, **kwargs)
Call self as a function.
Methods
__init__(x, y, func, **kwargs)A general Poisson likelihood for a rate - the model parameters are inferred from the arguments of function, which provides a rate.
log_likelihood(parameters)log_likelihood_ratio(parameters)Difference between log likelihood and noise log likelihood
model_parameters(parameters)This sets up the function only parameters (i.e. not sigma for the GaussianLikelihood) .
residual(parameters)Residual of the function against the data.
Attributes
Make func read-only
Makes function_keys read_only
marginalized_parametersmeta_dataThe number of data points
The independent variable.
Property assures that y-value is a positive integer.
- property func
Make func read-only
- property function_keys
Makes function_keys read_only
- log_likelihood(parameters)[source]
- Parameters:
- parameters: dict
A dictionary of the parameter names and associated values
- Returns:
- float
- log_likelihood_ratio(parameters)[source]
Difference between log likelihood and noise log likelihood
- Parameters:
- parameters: dict
A dictionary of the parameter names and associated values
- Returns:
- float
- model_parameters(parameters)[source]
This sets up the function only parameters (i.e. not sigma for the GaussianLikelihood)
- property n
The number of data points
- property x
The independent variable. Setter assures that single numbers will be converted to arrays internally
- property y
Property assures that y-value is a positive integer.