Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dirichlet_elicitation' into diri…
Browse files Browse the repository at this point in the history
…chlet_elicitation
  • Loading branch information
nishant42491 committed Feb 28, 2024
2 parents e233aa7 + cbc62a0 commit 1b07807
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dirichlet_prior_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@

def dirichlet_mode(mode, mass=0.90, bound=0.01, plot=True, plot_kwargs={}, ax=None):
"""
This function returns a Dirichlet distribution that has the specified mass concentrated in the region of
mode +- bound.
This function returns a Dirichlet distribution that has the specified mass concentrated in the
region of mode +- bound.
Parameters
----------
Expand Down Expand Up @@ -54,7 +53,7 @@ def dirichlet_mode(mode, mass=0.90, bound=0.01, plot=True, plot_kwargs={}, ax=No
raise ValueError("mode should be larger than 0")

if not abs(sum(mode) - 1) < 0.0001:
_log.warning("The mode should sum to 1, normalising mode to sum to 1")
warnings.warn("The mode should sum to 1, normalising mode to sum to 1")
sum_mode = sum(mode)
mode = [i / sum_mode for i in mode]

Expand Down

0 comments on commit 1b07807

Please sign in to comment.