class_docstr: Class to contain results from likelihood models 
class_docstr_tok: ["Class","to","contain","results","from","likelihood","models"]
docstr: The confidence interval of the specified theta estimates.
  
  Parameters
  ----------
  alpha : float, optional
      The `alpha` level for the confidence interval.
      ie., `alpha` = .05 returns a 95% confidence interval.
  cols : tuple, optional
      `cols` specifies which confidence intervals to return
  dispersion : None or scalar
      scale factor for the variance / covariance (see class docstring and
      ``vcov`` method docstring)
  
  Returns
  -------
  cis : ndarray
      `cis` is shape ``(len(cols), 2)`` where each row contains [lower,
      upper] for the given entry in `cols`
  
  Examples
  --------
  >>> from numpy.random import standard_normal as stan
  >>> from nipy.algorithms.statistics.models.regression import OLSModel
  >>> x = np.hstack((stan((30,1)),stan((30,1)),stan((30,1))))
  >>> beta=np.array([3.25, 1.5, 7.0])
  >>> y = np.dot(x,beta) + stan((30))
  >>> model = OLSModel(x).fit(y)
  >>> confidence_intervals = model.conf_int(cols=(1,2))
  
  Notes
  -----
  Confidence intervals are two-tailed.
  TODO:
  tails : string, optional
      `tails` can be "two", "upper", or "lower"
docstr_tok: ["The","confidence","interval","of","the","specified","theta","estimates",".","Parameters","--","--","--","--","--","alpha",":","float",",","optional","The","`","alpha","`","level","for","the","confidence","interval",".","ie.",",","`","alpha","`","=",".05","returns","a","95","%","confidence","interval",".","cols",":","tuple",",","optional","`","cols","`","specifies","which","confidence","intervals","to","return","dispersion",":","None","or","scalar","scale","factor","for","the","variance","\/","covariance","(","see","class","docstring","and","``","vcov","``","method","docstring",")","Returns","--","--","--","-","cis",":","ndarray","`","cis","`","is","shape","``","(","len","(","cols",")",",","2",")","``","where","each","row","contains","[","lower",",","upper","]","for","the","given","entry","in","`","cols","`","Examples","--","--","--","--",">",">",">","from","numpy.random","import","standard_normal","as","stan",">",">",">","from","nipy.algorithms.statistics.models.regression","import","OLSModel",">",">",">","x","=","np.hstack","(","(","stan","(","(","30,1",")",")",",","stan","(","(","30,1",")",")",",","stan","(","(","30,1",")",")",")",")",">",">",">","beta=np.array","(","[","3.25",",","1.5",",","7.0","]",")",">",">",">","y","=","np.dot","(","x",",","beta",")","+","stan","(","(","30",")",")",">",">",">","model","=","OLSModel","(","x",")",".fit","(","y",")",">",">",">","confidence_intervals","=","model.conf_int","(","cols=","(","1,2",")",")","Notes","--","--","-","Confidence","intervals","are","two-tailed",".","TODO",":","tails",":","string",",","optional","`","tails","`","can","be","``","two","''",",","``","upper","''",",","or","``","lower","''"]
code: def conf_int(self, alpha=0.05, cols=None, dispersion=None):
      """The confidence interval of the specified theta estimates.
  
      Parameters
      ----------
      alpha : float, optional
          The `alpha` level for the confidence interval.
          ie., `alpha` = .05 returns a 95% confidence interval.
      cols : tuple, optional
          `cols` specifies which confidence intervals to return
      dispersion : None or scalar
          scale factor for the variance / covariance (see class docstring and
          ``vcov`` method docstring)
  
      Returns
      -------
      cis : ndarray
          `cis` is shape ``(len(cols), 2)`` where each row contains [lower,
          upper] for the given entry in `cols`
  
      Examples
      --------
      >>> from numpy.random import standard_normal as stan
      >>> from nipy.algorithms.statistics.models.regression import OLSModel
      >>> x = np.hstack((stan((30,1)),stan((30,1)),stan((30,1))))
      >>> beta=np.array([3.25, 1.5, 7.0])
      >>> y = np.dot(x,beta) + stan((30))
      >>> model = OLSModel(x).fit(y)
      >>> confidence_intervals = model.conf_int(cols=(1,2))
  
      Notes
      -----
      Confidence intervals are two-tailed.
      TODO:
      tails : string, optional
          `tails` can be "two", "upper", or "lower"
      """
      if cols is None:
          lower = self.theta - inv_t_cdf(
              1 - alpha / 2, self.df_resid
          ) * np.sqrt(np.diag(self.vcov(dispersion=dispersion)))
          upper = self.theta + inv_t_cdf(
              1 - alpha / 2, self.df_resid
          ) * np.sqrt(np.diag(self.vcov(dispersion=dispersion)))
      else:
          lower, upper = [], []
          for i in cols:
              lower.append(
                  self.theta[i]
                  - inv_t_cdf(1 - alpha / 2, self.df_resid)
                  * np.sqrt(self.vcov(column=i, dispersion=dispersion))
              )
              upper.append(
                  self.theta[i]
                  + inv_t_cdf(1 - alpha / 2, self.df_resid)
                  * np.sqrt(self.vcov(column=i, dispersion=dispersion))
              )
      return np.asarray(list(zip(lower, upper)))
  
imports: import numpy
  from nibabel.onetime import auto_attr
  from numpy.linalg import inv
  from scipy.stats import t
  from ...utils.matrices import pos_recipr
label_desc: Use image node_id 9 for calling the LikelihoodModelResults obj's underlying member method code with example usage: obj.conf_int(alpha, cols, dispersion) and returns: np