'Returns the confidence interval of the fitted parameters.
Parameters
alpha : float, optional
The significance level for the confidence interval.
ie., The default `alpha` = .05 returns a 95% confidence interval.
cols : array-like, optional
`cols` specifies which confidence intervals to return
method : string
Not Implemented Yet
Method to estimate the confidence_interval.
"Default" : uses self.bse which is based on inverse Hessian for MLE
"hjjh" :
"jac" :
"boot-bse"
"boot_quant"
"profile"
Returns
conf_int : array
Each row contains [lower, upper] limits of the confidence interval
for the corresponding parameter. The first column contains all
lower, the second column contains all upper limits.
Examples
>>> import statsmodels.api as sm
>>> data = sm.datasets.longley.load()
>>> data.exog = sm.add_constant(data.exog)
>>> results = sm.OLS(data.endog, data.exog).fit()
>>> results.conf_int()
array([[-5496529.48322745, -1467987.78596704],
[    -177.02903529,      207.15277984],
[      -0.1115811 ,        0.03994274],
[      -3.12506664,       -0.91539297],
[      -1.5179487 ,       -0.54850503],
[      -0.56251721,        0.460309  ],
[     798.7875153 ,     2859.51541392]])
>>> results.conf_int(cols=(2,3))
array([[-0.1115811 ,  0.03994274],
[-3.12506664, -0.91539297]])
Notes
The confidence interval is based on the standard normal distribution.
Models wish to use a different distribution should overwrite this
method.'

def conf_int(self, alpha=0.05, cols=None, method='default'):

    bse = self.bse
    if self.use_t:
        dist = stats.t
        df_resid = getattr(self, 'df_resid_inference', self.df_resid)
        q = dist.ppf((1 - (alpha / 2)), df_resid)
    else:
        dist = stats.norm
        q = dist.ppf((1 - (alpha / 2)))
    if (cols is None):
        lower = (self.params - (q * bse))
        upper = (self.params + (q * bse))
    else:
        cols = np.asarray(cols)
        lower = (self.params[cols] - (q * bse[cols]))
        upper = (self.params[cols] + (q * bse[cols]))
    return np.asarray(lzip(lower, upper))
