class_docstr: A simple ordinary least squares model.
  
  Parameters
  ----------
  design : array-like
      This is your design matrix.  Data are assumed to be column ordered with
      observations in rows.
  
  Methods
  -------
  model.__init___(design)
  model.logL(b=self.beta, Y)
  
  Attributes
  ----------
  design : ndarray
      This is the design, or X, matrix.
  wdesign : ndarray
      This is the whitened design matrix.  `design` == `wdesign` by default
      for the OLSModel, though models that inherit from the OLSModel will
      whiten the design.
  calc_beta : ndarray
      This is the Moore-Penrose pseudoinverse of the whitened design matrix.
  normalized_cov_beta : ndarray
      ``np.dot(calc_beta, calc_beta.T)``
  df_resid : scalar
      Degrees of freedom of the residuals.  Number of observations less the
      rank of the design.
  df_model : scalar
      Degrees of freedome of the model.  The rank of the design.
  
  Examples
  --------
  >>> from nipy.algorithms.statistics.api import Term, Formula
  >>> data = np.rec.fromarrays(([1,3,4,5,2,3,4], range(1,8)),
  ...                          names=('Y', 'X'))
  >>> f = Formula([Term("X"), 1])
  >>> dmtx = f.design(data, return_float=True)
  >>> model = OLSModel(dmtx)
  >>> results = model.fit(data['Y'])
  >>> results.theta
  array([ 0.25      ,  2.14285714])
  >>> results.t()
  array([ 0.98019606,  1.87867287])
  >>> print(results.Tcontrast([0,1]))  #doctest: +FLOAT_CMP
  <T contrast: effect=2.14285714286, sd=1.14062281591, t=1.87867287326,
  df_den=5>
  >>> print(results.Fcontrast(np.eye(2)))  #doctest: +FLOAT_CMP
  <F contrast: F=19.4607843137, df_den=5, df_num=2>
docstr: Parameters
  ----------
  design : array-like
      This is your design matrix.
      Data are assumed to be column ordered with
      observations in rows.
docstr_tok: ["Parameters","--","--","--","--","--","design",":","array-like","This","is","your","design","matrix",".","Data","are","assumed","to","be","column","ordered","with","observations","in","rows","."]
code: def __init__(self, design):
      """
      Parameters
      ----------
      design : array-like
          This is your design matrix.
          Data are assumed to be column ordered with
          observations in rows.
      """
      super().__init__()
      self.initialize(design)
  
imports: import warnings
  import numpy
  import numpy.linalg
  import scipy.linalg
  from nibabel.onetime import auto_attr
  from scipy import stats
  from nipy.algorithms.utils.matrices import matrix_rank, pos_recipr
  from .model import LikelihoodModel, LikelihoodModelResults
label_desc: Use image node_id 1 to create a new OLSModel object from inherited base classes: LikelihoodModel with example: obj = OLSModel(design)