code: def test_multivariate_forms():
      # MVform with one sphere is sqrt(chi^2), two spheres is sqrt(Roy) with
      # infinite degrees of freedom.
      x = np.linspace(0.1, 10, 100)
      for k1 in range(5, 10):
          m = rft.MultilinearForm(k1)
          c = rft.ChiSquared(k1)
          for dim in range(7):
              mx = m.density(x, dim)
              cx = c.density(x**2, dim)
              assert_almost_equal(mx, cx)
          for k2 in range(5, 10):
              m = rft.MultilinearForm(k1, k2)
              r = rft.Roy(k=k1, dfn=k2, dfd=np.inf)
              for dim in range(7):
                  mx = 2 * m.density(x, dim)
                  rx = r.density(x**2 / k2, dim)
                  assert_almost_equal(mx, rx)
  
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 25 for calling a global function with example usage: test_multivariate_forms() without return types