nemos.observation_models.GammaObservations.log_likelihood#
- GammaObservations.log_likelihood(y, predicted_rate, scale=1.0, aggregate_sample_scores=<function mean>)[source]#
Compute the Gamma negative log-likelihood.
This computes the Gamma negative log-likelihood of the predicted rates for the observed neural activity including the normalization constant.
- Parameters:
y (
Array
) – The target activity to compare against. Shape (n_time_bins, ) or (n_time_bins, n_neurons).predicted_rate (
Array
) – The predicted rate of the current model. Shape (n_time_bins, ) or (n_time_bins, n_neurons).scale (
Union
[float
,Array
]) – The scale parameter of the model.aggregate_sample_scores (
Callable
) – Function that aggregates the log-likelihood of each sample.
- Returns:
The Gamma negative log-likelihood. Shape (1,).