Skip to content

Commit 124c1c0

Browse files
author
Junpeng Lao
authored
Small change in pymc3.stats._log_post_trace (pymc-devs#2721)
Small change in the function so that: 1, The input argument match with the doc string 2, The style match with other functions Small change so I am not adding to the release note.
1 parent 2a0351e commit 124c1c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymc3/stats.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def dic(trace, model=None):
129129
return 2 * mean_deviance - deviance_at_mean
130130

131131

132-
def _log_post_trace(trace, model, progressbar=False):
132+
def _log_post_trace(trace, model=None, progressbar=False):
133133
"""Calculate the elementwise log-posterior for the sampled trace.
134134
135135
Parameters
@@ -147,6 +147,7 @@ def _log_post_trace(trace, model, progressbar=False):
147147
logp : array of shape (n_samples, n_observations)
148148
The contribution of the observations to the logp of the whole model.
149149
"""
150+
model = modelcontext(model)
150151
cached = [(var, var.logp_elemwise) for var in model.observed_RVs]
151152

152153
def logp_vals_point(pt):

0 commit comments

Comments
 (0)