Skip to content

Commit 277f9d3

Browse files
committed
use chain order rather than logical index with _DefaultTrace.insert
1 parent 9aa0dc7 commit 277f9d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymc3/backends/arviz.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,12 @@ def _extract_log_likelihood(self, trace):
206206
]
207207
log_likelihood_dict = _DefaultTrace(len(trace.chains))
208208
for var, log_like_fun in cached:
209-
for chain in trace.chains:
209+
for k, chain in enumerate(trace.chains):
210210
log_like_chain = [
211211
self.log_likelihood_vals_point(point, var, log_like_fun)
212212
for point in trace.points([chain])
213213
]
214-
log_likelihood_dict.insert(var.name, np.stack(log_like_chain), chain)
214+
log_likelihood_dict.insert(var.name, np.stack(log_like_chain), k)
215215
return log_likelihood_dict.trace_dict
216216

217217
@requires("trace")

0 commit comments

Comments
 (0)