code: def test_cov(cov, nobs, cov_null):
      """One sample hypothesis test for covariance equal to null covariance
  
      The Null hypothesis is that cov = cov_null, against the alternative that
      it is not equal to cov_null
  
      Parameters
      ----------
      cov : array_like
          Covariance matrix of the data, estimated with denominator ``(N - 1)``,
          i.e. `ddof=1`.
      nobs : int
          number of observations used in the estimation of the covariance
      cov_null : nd_array
          covariance under the null hypothesis
  
      Returns
      -------
      res : instance of HolderTuple
          results with ``statistic, pvalue`` and other attributes like ``df``
  
      References
      ----------
      Bartlett, M. S. 1954. “A Note on the Multiplying Factors for Various Χ2
      Approximations.” Journal of the Royal Statistical Society. Series B
      (Methodological) 16 (2): 296–98.
  
      Rencher, Alvin C., and William F. Christensen. 2012. Methods of
      Multivariate Analysis: Rencher/Methods. Wiley Series in Probability and
      Statistics. Hoboken, NJ, USA: John Wiley & Sons, Inc.
      https://doi.org/10.1002/9781118391686.
  
      StataCorp, L. P. Stata Multivariate Statistics: Reference Manual.
      Stata Press Publication.
  
      """
      # using Stata formulas where cov_sample use nobs in denominator
      # Bartlett 1954 has fewer terms
  
      S = np.asarray(cov) * (nobs - 1) / nobs
      S0 = np.asarray(cov_null)
      k = cov.shape[0]
      n = nobs
  
      fact = nobs - 1.0
      fact *= 1 - (2 * k + 1 - 2 / (k + 1)) / (6 * (n - 1) - 1)
      fact2 = _logdet(S0) - _logdet(n / (n - 1) * S)
      fact2 += np.trace(n / (n - 1) * np.linalg.solve(S0, S)) - k
      statistic = fact * fact2
      df = k * (k + 1) / 2
      pvalue = stats.chi2.sf(statistic, df)
      return HolderTuple(
          statistic=statistic,
          pvalue=pvalue,
          df=df,
          distr="chi2",
          null="equal value",
          cov_null=cov_null,
      )
  
file_path: statsmodels/statsmodels/stats/multivariate.py
imports: import numpy
  from scipy import stats
  from statsmodels.stats.moment_helpers import cov2corr
  from statsmodels.stats.base import HolderTuple
  from statsmodels.tools.validation import array_like
label_desc: Use image node_id 6 for calling a global function with example usage: test_cov(cov, nobs, cov_null) and returns: HolderTuple