jerome-white commited on
Commit
adb3a9b
1 Parent(s): 2673c60

Denote when target is not in any HDI

Browse files
Files changed (1) hide show
  1. app.py +19 -11
app.py CHANGED
@@ -150,18 +150,26 @@ class ComparisonPlotter(DataPlotter):
150
  ax.set_xlabel('logit$^{-1}$(\u03B1$_{1}$ - \u03B1$_{2}$)')
151
 
152
  self.pr(ax, hdi, c_hdi)
 
 
 
153
  try:
154
- ci_min = self.interval.at(self._uncertain)
155
- ax.text(x=0.02,
156
- y=0.975,
157
- s=f'{self._uncertain} \u2208 {ci_min:.0%} HDI',
158
- fontsize='small',
159
- fontstyle='italic',
160
- horizontalalignment='left',
161
- verticalalignment='top',
162
- transform=ax.transAxes)
163
- except ArithmeticError:
164
- pass
 
 
 
 
 
165
 
166
  def pr(self, ax, hdi, color):
167
  x = self.df.median()
 
150
  ax.set_xlabel('logit$^{-1}$(\u03B1$_{1}$ - \u03B1$_{2}$)')
151
 
152
  self.pr(ax, hdi, c_hdi)
153
+ self.min_inclusive(ax)
154
+
155
+ def min_inclusive(self, ax):
156
  try:
157
+ ci = self.interval.at(self._uncertain)
158
+ inclusive = '\u2208'
159
+ except OverflowError:
160
+ ci = 1
161
+ inclusive = '\u2209'
162
+ except FloatingPointError:
163
+ return
164
+
165
+ ax.text(x=0.02,
166
+ y=0.975,
167
+ s=f'{self._uncertain} {inclusive} {ci:.0%} HDI',
168
+ fontsize='small',
169
+ fontstyle='italic',
170
+ horizontalalignment='left',
171
+ verticalalignment='top',
172
+ transform=ax.transAxes)
173
 
174
  def pr(self, ax, hdi, color):
175
  x = self.df.median()