#NEWLINE# def __init__( self , data , dist = stats . norm , fit = False , distargs = ( ) , a = 0 , loc = 0 , scale = 1 ) : #NEWLINE# #INDENT# self . data = data #NEWLINE# self . a = a #NEWLINE# self . nobs = data . shape [ 0 ] #NEWLINE# self . distargs = distargs #NEWLINE# self . fit = fit #NEWLINE# if isinstance ( dist , string_types ) : #NEWLINE# #INDENT# dist = getattr ( stats , dist ) #NEWLINE# #UNINDENT# self . fit_params = dist . fit ( data ) #NEWLINE# if fit : #NEWLINE# #INDENT# self . loc = self . fit_params [ ( - 2 ) ] #NEWLINE# self . scale = self . fit_params [ ( - 1 ) ] #NEWLINE# if ( len ( self . fit_params ) > 2 ) : #NEWLINE# #INDENT# self . dist = dist ( * self . fit_params [ : ( - 2 ) ] , ** dict ( loc = 0 , scale = 1 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . dist = dist ( loc = 0 , scale = 1 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( distargs or ( loc == 0 ) or ( a == 1 ) ) : #NEWLINE# #INDENT# self . dist = dist ( * distargs , ** dict ( loc = loc , scale = scale ) ) #NEWLINE# self . loc = loc #NEWLINE# self . scale = scale #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . dist = dist #NEWLINE# self . loc = loc #NEWLINE# self . scale = scale #NEWLINE# #UNINDENT# #UNINDENT# self . _cache = resettable_cache ( )