Closed drbenvincent closed 5 years ago
Silly me. We already have this as Model.log_likelihood
but the implementation is a bit hacky.
The implementation was not wrong before. But now it's slightly improved and clearer with explicit use of the Bernoulli logpmf.
Write a method in the
Model
class to return the log likelihood of the data. This will be useful in general, but I'm doing this to resolve model comparison as part of #57.It's basically just correct use of
bernoulli.logpmf(responses, predicted_response_probabilities)
.responses
will be a vector of T binary responsespredicted_response_probabilities
is what it sounds like. But it will be a matrix of size[T, P]
whereT
is number of trials andP
is number of particles. Although it will be a vector lengthT
if we want to just use the median parameter estimates for example. Maybe have this as an option through a keyword argument in the method call.