Closed rmnldwg closed 1 year ago
In a similar fashion: I don't like having numerous different likelihood functions all with long, convoluted names that call each other. Ideally, I would like to have a likelihood that reads like a sentence:
model.likelihood(of=data, given=params, log=True)
However, this would lead to unreadable method code. Maybe a compromise would be something like
model.likelihood(data=data, given_params=theta, log=True)
which looses little in terms of API readability but is actually quite nice in the source code as well.
the new likelihood method implemented in the commits up to 1cde3e720dba895f6e3d51fd839b9fb791917fd9 is much more semantic and readable
I found out that emcee's
EnsembleSampler
has aparameter_names
argument. Providing it, the sampler will then pass a dictionary of values to the likelihood function. With this I could make the likelihood function semantic, instead of describing in a lot of detail where to put which sets of parameters.