class_docstr: Class to contain results from likelihood models 
class_docstr_tok: ["Class","to","contain","results","from","likelihood","models"]
docstr: Set up results structure
  
  Parameters
  ----------
  theta : ndarray
      parameter estimates from estimated model
  Y : ndarray
      data
  model : ``LikelihoodModel`` instance
      model used to generate fit
  cov : None or ndarray, optional
      covariance of thetas
  dispersion : scalar, optional
      multiplicative factor in front of `cov`
  nuisance : None of ndarray
      parameter estimates needed to compute logL
  rank : None or scalar
      rank of the model.  If rank is not None, it is used for df_model
      instead of the usual counting of parameters.
  
  Notes
  -----
  The covariance of thetas is given by:
  
      dispersion * cov
  
  For (some subset of models) `dispersion` will typically be the mean
  square error from the estimated model (sigma^2)
docstr_tok: ["Set","up","results","structure","Parameters","--","--","--","--","--","theta",":","ndarray","parameter","estimates","from","estimated","model","Y",":","ndarray","data","model",":","``","LikelihoodModel","``","instance","model","used","to","generate","fit","cov",":","None","or","ndarray",",","optional","covariance","of","thetas","dispersion",":","scalar",",","optional","multiplicative","factor","in","front","of","`","cov","`","nuisance",":","None","of","ndarray","parameter","estimates","needed","to","compute","logL","rank",":","None","or","scalar","rank","of","the","model",".","If","rank","is","not","None",",","it","is","used","for","df_model","instead","of","the","usual","counting","of","parameters",".","Notes","--","--","-","The","covariance","of","thetas","is","given","by",":","dispersion","*","cov","For","(","some","subset","of","models",")","`","dispersion","`","will","typically","be","the","mean","square","error","from","the","estimated","model","(","sigma^2",")"]
code: def __init__(
      self,
      theta,
      Y,
      model,
      cov=None,
      dispersion=1.0,
      nuisance=None,
      rank=None,
  ):
      """Set up results structure
  
      Parameters
      ----------
      theta : ndarray
          parameter estimates from estimated model
      Y : ndarray
          data
      model : ``LikelihoodModel`` instance
          model used to generate fit
      cov : None or ndarray, optional
          covariance of thetas
      dispersion : scalar, optional
          multiplicative factor in front of `cov`
      nuisance : None of ndarray
          parameter estimates needed to compute logL
      rank : None or scalar
          rank of the model.  If rank is not None, it is used for df_model
          instead of the usual counting of parameters.
  
      Notes
      -----
      The covariance of thetas is given by:
  
          dispersion * cov
  
      For (some subset of models) `dispersion` will typically be the mean
      square error from the estimated model (sigma^2)
      """
      self.theta = theta
      self.Y = Y
      self.model = model
      if cov is None:
          self.cov = self.model.information(
              self.theta, nuisance=self.nuisance
          )
      else:
          self.cov = cov
      self.dispersion = dispersion
      self.nuisance = nuisance
  
      self.df_total = Y.shape[0]
      self.df_model = model.df_model
      # put this as a parameter of LikelihoodModel
      self.df_resid = self.df_total - self.df_model
  
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 1 to create a new LikelihoodModelResults object  with example: obj = LikelihoodModelResults(theta, Y, model, cov, dispersion, nuisance, rank)