You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In emcee I added a PR for having named parameters (proposal, and the PR). This allows for dict-like access to the parameters rather than positional references. Example:
x=np.random.randn(100) # 100 samples ~ N(0, 1)deflnpdf(self, params: Dict[str, float]) ->np.float64:
# A gaussian PDF with named parametersmean=params["mean"]
var=params["var"]
ifvar<=0:
return-np.infreturn (
-0.5* ((mean-self.x) **2/var+np.log(2*np.pi*var)).sum()
)
The main benefit is this allows one to build hierarchical models without having to remember "oh the first parameter for the N-th submodel is at position XYZ" (a common source of bugs).
Since zeus has the same API, I'd be happy to add it here too.
The text was updated successfully, but these errors were encountered:
In
emcee
I added a PR for having named parameters (proposal, and the PR). This allows for dict-like access to the parameters rather than positional references. Example:The main benefit is this allows one to build hierarchical models without having to remember "oh the first parameter for the N-th submodel is at position XYZ" (a common source of bugs).
Since
zeus
has the same API, I'd be happy to add it here too.The text was updated successfully, but these errors were encountered: