code: def test_hotelling2():
      # Marginally, Hotelling's T^2(k) with m degrees of freedom
      # in the denominator satisfies
      # (m-k+1)/(mk) T^2 \sim  F_{k,m-k+1}.
      x = np.linspace(0.1, 10, 100)
      for dfn in range(6, 10):
          h = rft.Hotelling(k=dfn)(x)
          chi = rft.ChiSquared(dfn=dfn)(x)
          assert_almost_equal(h, chi)
          chi2 = scipy.stats.chi2.sf(x, dfn)
          assert_almost_equal(h, chi2)
          # XXX - p appears to be unused
          p = rft.spherical_search(dfn)
          for dfd in [40, 50]:
              fac = (dfd - dfn + 1.0) / (dfd * dfn)
              h = rft.Hotelling(dfd=dfd, k=dfn)(x)
              f = scipy.stats.f.sf(x * fac, dfn, dfd - dfn + 1)
              f2 = rft.FStat(dfd=dfd - dfn + 1, dfn=dfn)(x * fac)
              assert_almost_equal(f2, f)
              assert_almost_equal(h, f)
  
imports: import numpy
  import scipy.stats
  from scipy.special import gammaln, hermitenorm
  import pytest
  from numpy.testing import assert_almost_equal
  from ..None import rft
label_desc: Use image node_id 22 for calling a global function with example usage: test_hotelling2() without return types