class_docstr: generic moment tests or conditional moment tests for Quasi-MLE
  
  This is a generic class based on Tauchen 1985
  
  The main method is `chisquare` which returns the result of the
  conditional moment test.
  
  Warning: name of class and of methods will likely be changed
  
  Parameters
  ----------
  score : ndarray, 1-D
      moment condition used in estimation, score of log-likelihood function
  score_deriv : ndarray
      derivative of score function with respect to the parameters that are
      estimated. This is the Hessian in quasi-maximum likelihood
  moments : ndarray, 1-D
      moments that are tested to be zero. They do not need to be derived
      from a likelihood function.
  moments_deriv : ndarray
      derivative of the moment function with respect to the parameters that
      are estimated
  cov_moments : ndarray
      An estimate for the joint (expected) covariance of score and test
      moments. This can be a heteroscedasticity or correlation robust
      covariance estimate, i.e. the inner part of a sandwich covariance.
docstr: statistic, p-value and degrees of freedom of joint moment test
          
docstr_tok: ["statistic",",","p-value","and","degrees","of","freedom","of","joint","moment","test"]
code: def chisquare(self):
      """statistic, p-value and degrees of freedom of joint moment test"""
      diff = self.moments  # _constraints
      cov = self.cov_mom_constraints
  
      # Newey uses a generalized inverse, we use it also here
      stat = diff.T.dot(np.linalg.pinv(cov).dot(diff))
      # df = self.k_moments_test
      # We allow for redundant mom_constraints:
      df = self.rank_cov_mom_constraints
      pval = stats.chi2.sf(stat, df)
      return stat, pval, df
  
imports: import warnings
  import numpy
  from scipy import stats
  from statsmodels.tools.decorators import cache_readonly
  from statsmodels.regression.linear_model import OLS
label_desc: Use image node_id 6 for calling the CMTTauchen obj's underlying member method code with example usage: obj.chisquare() and returns: stat,  pval,  df