@@ -714,16 +714,17 @@ def estimate_tau(self):
714
714
taus = 1 / rp .rates [rp .labels == index ]
715
715
wts = rp .weights [rp .labels == index ]
716
716
ci = confidence_interval (taus )
717
- #h = np.histogram(taus, bins='sqrt')
718
- #indmax = h[0].argmax()
719
- #val = 0.5 * (h[1][:-1][indmax] + h[1][1:][indmax])
720
-
721
- wbins = np .histogram_bin_edges (wts , bins = bintype )
722
- rbins = np .histogram_bin_edges (taus , bins = bintype )
723
- vals , ws , rs = np .histogram2d (wts , taus , bins = [wbins ,rbins ])
724
- indmax = np .unravel_index (vals .argmax (), vals .shape )
725
- rval = 0.5 * (rs [:- 1 ] + rs [1 :])[indmax [1 ]]
726
- return [ci [0 ], rval , ci [1 ]]
717
+ h = np .histogram (taus , bins = 'sqrt' )
718
+ indmax = h [0 ].argmax ()
719
+ val = 0.5 * (h [1 ][:- 1 ][indmax ] + h [1 ][1 :][indmax ])
720
+
721
+ # Used for finding maximum of weight vs tau 2d distribution
722
+ #wbins = np.histogram_bin_edges(wts, bins=bintype)
723
+ #rbins = np.histogram_bin_edges(taus, bins=bintype)
724
+ #vals, ws, rs = np.histogram2d(wts, taus, bins=[wbins,rbins])
725
+ #indmax = np.unravel_index(vals.argmax(), vals.shape)
726
+ #val = 0.5 * (rs[:-1] + rs[1:])[indmax[1]]
727
+ return [ci [0 ], val , ci [1 ]]
727
728
728
729
def plot_surv (self , scale = 1 , remove_noise = False , save = False , xlim = None ,
729
730
ylim = (1e-6 , 5 ), xmajor = None , xminor = None ):
0 commit comments