#NEWLINE# def testFitPowerLaw( self ) : #NEWLINE# #INDENT# alpha = 2.7 #NEWLINE# xmin = 1.0 #NEWLINE# exponent = ( 1 / alpha ) #NEWLINE# numPoints = 15000 #NEWLINE# x = ( numpy . random . rand ( numPoints ) ** ( - alpha2 ) ) #NEWLINE# x = x [ ( x >= 1 ) ] #NEWLINE# alpha2 = Util . fitPowerLaw ( x , xmin ) #NEWLINE# self . assertAlmostEquals ( alpha , alpha2 , places = 1 )