Skip to content

Commit

Permalink
fix ?
Browse files Browse the repository at this point in the history
  • Loading branch information
VanyaBelyaev committed Sep 18, 2024
1 parent d04e482 commit 0aeb151
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ostap/stats/gof1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
# =============================================================================
logger.debug ( 'Simple utilities for goodness-of-1D-fit studies' )
# =============================================================================
if ( 6 , 32 ) <= root_info : data2vct = lambda s : s
else : data2vct = lambda s : doubles ( s )
# =============================================================================
## Get Kolmogorov-Smirnov statistis KS
# @code
# cdf_data =...
Expand Down Expand Up @@ -189,9 +192,9 @@ def __init__ ( self ,

## sorted data
self.__data = np.sort ( data )

## empirical CDF function
self.__ecdf = Ostap.Math.ECDF ( self.__data )
self.__ecdf = Ostap.Math.ECDF ( data2vct ( self.__data ) )

## evalute CDF for sorted data
self.__cdf_data = vct_cdf ( self.__data )
Expand Down Expand Up @@ -474,7 +477,7 @@ def run ( self , nToys = 1000 , silent = False ) :
data = results [ key ]
if not data : continue
if not key in self.__ecdfs : self.__ecdfs [ key ] = ECDF ( data , True ) ## complementary ECDF!
else : self.__ecdfs [ key ] .add ( doubles ( data ) )
else : self.__ecdfs [ key ] .add ( data2vct ( data ) )

del results

Expand Down

0 comments on commit 0aeb151

Please sign in to comment.