class_docstr: Generic tests for copula.
class_docstr_tok: ["Generic","tests","for","copula","."]
code: def test_rvs(self):
      nobs = 2000
      rng = np.random.RandomState(27658622)
      self.rvs = rvs = self.copula.rvs(nobs, random_state=rng)
      assert rvs.shape == (nobs, 2)
      assert_array_almost_equal(
          np.mean(rvs, axis=0), np.repeat(0.5, self.dim), decimal=2
      )
  
      # check empirical quantiles, uniform
      q0 = np.percentile(rvs, [25, 50, 75], axis=0)
      q1 = np.repeat(np.array([[0.25, 0.5, 0.75]]).T, 2, axis=1)
      assert_allclose(q0, q1, atol=0.025)
  
      tau = stats.kendalltau(*rvs.T)[0]
      tau_cop = self.copula.tau()
      assert_allclose(tau, tau_cop, rtol=0.08, atol=0.005)
  
      if isinstance(self.copula, IndependenceCopula):
          # skip rest, no `_arg_from_tau` in IndependenceCopula
          return
      theta = self.copula.fit_corr_param(rvs)
      theta_cop = getattr(self.copula, "theta", None)
      if theta_cop is None:
          # elliptical
          theta_cop = self.copula.corr[0, 1]
      assert_allclose(theta, theta_cop, rtol=0.1, atol=0.005)
  
imports: import warnings
  from statsmodels.compat.pytest import pytest_warns
  from statsmodels.compat.scipy import SP_LT_15
  import numpy
  from numpy.testing import assert_allclose, assert_array_almost_equal
  import pytest
  from scipy import stats
  from statsmodels.distributions.copula.archimedean import ArchimedeanCopula, ClaytonCopula, FrankCopula, GumbelCopula, _debyem1_expansion
  from statsmodels.distributions.copula.copulas import CopulaDistribution
  import statsmodels.distributions.copula.depfunc_ev
  from statsmodels.distributions.copula.elliptical import GaussianCopula, StudentTCopula
  from statsmodels.distributions.copula.extreme_value import ExtremeValueCopula, copula_bv_ev
  from statsmodels.distributions.copula.other_copulas import IndependenceCopula
  import statsmodels.distributions.copula.transforms
  from statsmodels.distributions.tools import approx_copula_pdf, frequencies_fromdata
  from statsmodels.tools.numdiff import approx_fprime_cs, approx_hess
label_desc: Use image node_id 5 for calling the CheckCopula obj's underlying member method code with example usage: obj.test_rvs() without return types