Skip to content

Commit

Permalink
Merge changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mwshinn committed Dec 22, 2021
2 parents b4f9d8a + 7272e63 commit a529ecb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ddm/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def resample(self, k=1, seed=0):
shift = np.max(shorter_t_domain)+1
combined_domain = list(shorter_t_domain) + list(shorter_t_domain+shift) + [-1]
combined_probs = list(shorter_pdf_corr*self.model.dt) + list(shorter_pdf_err*self.model.dt) + [self.prob_undecided()]
if np.sum(combined_probs) != 1:
if np.abs(np.sum(combined_probs)-1) >= .0001:
print("Warning, distribution sums to %f rather than 1" % np.sum(combined_probs))
samp = np.random.choice(combined_domain, p=combined_probs, replace=True, size=k)
undecided = np.sum(samp==-1)
Expand Down

0 comments on commit a529ecb

Please sign in to comment.