#NEWLINE# def smoothed_hazard_confidence_intervals_( self , bandwidth , hazard_ = None ) : #NEWLINE# #INDENT# '\n        Parameter:\n          bandwidth: the bandwith to use in the Epanechnikov kernel.\n          hazard_: a computed (n,) numpy array of estimated hazard rates. If none, uses naf.smoothed_hazard_\n        ' #NEWLINE# if ( hazard_ is None ) : #NEWLINE# #INDENT# hazard_ = self . smoothed_hazard_ ( bandwidth ) . values [ : , 0 ] #NEWLINE# #UNINDENT# timeline = self . timeline #NEWLINE# alpha2 = inv_normal_cdf ( ( 1 - ( ( 1 - self . alpha ) / 2 ) ) ) #NEWLINE# self . _cumulative_sq . iloc [ 0 ] = 0 #NEWLINE# var_hazard_ = self . _cumulative_sq . diff ( ) . fillna ( self . _cumulative_sq . iloc [ 0 ] ) #NEWLINE# C = ( var_hazard_ . values != 0.0 ) #NEWLINE# std_hazard_ = np . sqrt ( ( ( 1.0 / ( bandwidth ** 2 ) ) * np . dot ( ( epanechnikov_kernel ( timeline [ : , None ] , timeline [ C ] [ None , : ] , bandwidth ) ** 2 ) , alpha2 . values [ C ] ) ) ) #NEWLINE# values = { #NEWLINE# #INDENT# self . ci_labels [ 0 ] : ( hazard_ * np . exp ( ( ( alpha2 * std_hazard_ ) / hazard_ ) ) ) , #NEWLINE# self . ci_labels [ 1 ] : ( hazard_ * np . exp ( ( ( ( - alpha2 ) * std_hazard_ ) / hazard_ ) ) ) , #NEWLINE# #UNINDENT# } #NEWLINE# return pd . DataFrame ( values , index = timeline )