#NEWLINE# def conf_int_el( self , param_num , upper_bound = None , lower_bound = None , sig = 0.05 , method = 'nm' , stochastic_exog = 1 ) : #NEWLINE# #INDENT# "\n        Returns the confidence interval for a regression parameter when the\n        regression is forced through the origin\n\n        Parameters\n        ----------\n        param_num : int\n            The parameter number to be tested.  Note this uses python\n            indexing but the '0' parameter refers to the intercept term\n\n        upper_bound : float\n            The maximum value the upper confidence limit can be.  The\n            closer this is to the confidence limit, the quicker the\n            computation.  Default is .00001 confidence limit under normality\n\n        lower_bound : float\n            The minimum value the lower confidence limit can be.\n            Default is .00001 confidence limit under normality\n\n        sig : float, optional\n            The significance level.  Default .05\n\n        method : str, optional\n             Algorithm to optimize of nuisance params.  Can be 'nm' or\n            'powell'.  Default is 'nm'.\n\n        Returns\n        -------\n        ci: tuple\n            The confidence interval for the parameter 'param_num'\n        " #NEWLINE# r0 = chi2 . ppf ( ( 1 - sig ) , 1 ) #NEWLINE# param_num = np . array ( [ param_num ] ) #NEWLINE# if ( upper_bound is None ) : #NEWLINE# #INDENT# upper_bound = np . squeeze ( self . model . fit ( ) . conf_int ( 0.0001 ) [ stochastic_exog ] ) [ 1 ] #NEWLINE# #UNINDENT# if ( lower_bound is None ) : #NEWLINE# #INDENT# lower_bound = np . squeeze ( self . model . fit ( ) . conf_int ( 1e-05 ) [ param_num ] ) [ 0 ] #NEWLINE# #UNINDENT# f = ( lambda b0 : ( self . el_test ( np . array ( [ b0 ] ) , param_num , method = method , stochastic_exog = stochastic_exog ) [ 0 ] - r0 ) ) #NEWLINE# lowerl = optimize . brentq ( f , lower_bound , self . params [ param_num ] ) #NEWLINE# upperl = optimize . brentq ( f , self . params [ param_num ] , upper_bound ) #NEWLINE# return ( lowerl , upperl )