docstr: Specify and estimate a contrast
  
  c must be a numpy.ndarray (or anything that numpy.asarray
  can cast to a ndarray).
  For a F contrast, c must be q x p
  where q is the number of contrast vectors and
  p is the total number of regressors.
docstr_tok: ["Specify","and","estimate","a","contrast","c","must","be","a","numpy.ndarray","(","or","anything","that","numpy.asarray","can","cast","to","a","ndarray",")",".","For","a","F","contrast",",","c","must","be","q","x","p","where","q","is","the","number","of","contrast","vectors","and","p","is","the","total","number","of","regressors","."]
code: def contrast(self, c, type="t", tiny=DEF_TINY, dofmax=DEF_DOFMAX):
      """Specify and estimate a contrast
  
      c must be a numpy.ndarray (or anything that numpy.asarray
      can cast to a ndarray).
      For a F contrast, c must be q x p
      where q is the number of contrast vectors and
      p is the total number of regressors.
      """
      c = np.asarray(c)
      # dim = len(c.shape)
      if c.ndim == 1:
          dim = 1
      else:
          dim = c.shape[0]
      axis = self._axis
      ndims = len(self.beta.shape)
  
      # Compute the contrast estimate: c*B
      B = np.rollaxis(self.beta, axis, ndims)
      con = np.inner(c, B)  # shape = q, X
  
      # Compute the variance of the contrast estimate: s2 * (c' * nvbeta * c)
      # Two cases are considered: either the input effect variance
      # is position-dependent (output by RKF_fit), or it is a global
      # one (output by KF_fit)
      s2 = self.s2.squeeze()
      nvbeta = self.nvbeta
      if "nvbeta" not in self._constants:
          nvbeta = np.rollaxis(nvbeta, axis, ndims + 1)
          nvbeta = np.rollaxis(
              nvbeta, axis, ndims + 1
          )  # shape = X, p, p
      if dim == 1:
          vcon = np.inner(c, np.inner(c, nvbeta))
          vcon = vcon.squeeze() * s2
      else:
          vcon = np.dot(c, np.inner(nvbeta, c))  # q, X, q or q, q
          if "nvbeta" not in self._constants:
              vcon = np.rollaxis(vcon, ndims, 1) * s2  # q, q, X
          else:
              aux = vcon.shape  # q, q
              vcon = np.resize(vcon, s2.shape + aux)  # X, q, q
              vcon = vcon.T.reshape(aux + (s2.size,)) * s2.reshape(
                  (s2.size,)
              )  # q, q, Xflat
              vcon = vcon.reshape(aux + s2.shape)  # q, q, X
  
      # Create contrast instance
      c = contrast(dim, type, tiny, dofmax)
      c.effect = con
      c.variance = vcon
      c.dof = self.dof
      return c
  
imports: import numpy
  import scipy.stats
  from nipy.algorithms.statistics.utils import z_score
  from ..utils import mahalanobis
  from .None import kalman
label_desc: Use image node_id 4 for calling the glm obj's underlying member method code with example usage: obj.contrast(c, type, tiny, dofmax) and returns: c