Skip to content

Commit

Permalink
Handles case with semi-deterministic elements
Browse files Browse the repository at this point in the history
  • Loading branch information
tingiskhan committed Nov 14, 2024
1 parent b4f43b0 commit 29fb53d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion skyro/_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ def _process_results(self, mcmc: MCMC) -> NumpyroResultSet:

# TODO: need to handle case when some of the dimensions of the variables are nan
for name, summary_ in s.items():
if (summary_["r_hat"] <= self.max_rhat).all():
# NB: some variables have deterministic elements (s.a. samples from LKJCov).
mask = np.isnan(summary_["n_eff"])
r_hat = summary_["r_hat"][~mask]

if (r_hat <= self.max_rhat).all():
continue

raise ConvergenceError(f"Parameter '{name}' did not converge!")
Expand Down

0 comments on commit 29fb53d

Please sign in to comment.