code: def test_skewstudent(self, seed):
      dist = SkewStudent(seed=seed)
      assert dist.parameter_names() == ["eta", "lambda"]
      eta, lam = 4.0, 0.5
      ll1 = dist.loglikelihood(
          np.array([eta, lam]), self.resids, self.sigma2
      )
      # Direct calculation of PDF, then log
      const_c = gamma((eta + 1) / 2) / (
          (np.pi * (eta - 2)) ** 0.5 * gamma(eta / 2)
      )
      const_a = 4 * lam * const_c * (eta - 2) / (eta - 1)
      const_b = (1 + 3 * lam**2 - const_a**2) ** 0.5
  
      resids = self.resids / self.sigma2**0.5
      power = -(eta + 1) / 2
      pdf = (
          const_b
          * const_c
          / self.sigma2**0.5
          * (
              1
              + 1
              / (eta - 2)
              * (
                  (const_b * resids + const_a)
                  / (1 + np.sign(resids + const_a / const_b) * lam)
              )
              ** 2
          )
          ** power
      )
  
      ll2 = np.log(pdf).sum()
      assert_almost_equal(ll1, ll2)
  
      assert_equal(dist.num_params, 2)
  
      bounds = dist.bounds(self.resids)
      assert_equal(len(bounds), 2)
  
      a, b = dist.constraints()
      assert_equal(a.shape, (4, 2))
  
      k = stats.kurtosis(self.resids, fisher=False)
      sv = max((4.0 * k - 6.0) / (k - 3.0) if k > 3.75 else 12.0, 4.0)
      assert_array_equal(
          dist.starting_values(self.resids), np.array([sv, 0.0])
      )
  
      with pytest.raises(ValueError):
          dist.simulate(np.array([1.5, 0.0]))
      with pytest.raises(ValueError):
          dist.simulate(np.array([4.0, 1.5]))
      with pytest.raises(ValueError):
          dist.simulate(np.array([4.0, -1.5]))
      with pytest.raises(ValueError):
          dist.simulate(np.array([1.5, 1.5]))
  
      sim = dist.simulate([8.0, -0.2])
      assert isinstance(sim(100), np.ndarray)
  
file_path: arch/arch/tests/univariate/test_distribution.py
imports: import numpy
  from numpy.random import RandomState, default_rng
  from numpy.testing import assert_almost_equal, assert_array_equal, assert_equal
  import pytest
  from scipy.special import gamma, gammaln
  import scipy.stats
  from arch.univariate.distribution import GeneralizedError, Normal, SkewStudent, StudentsT
label_desc: Use image node_id 4 for calling the TestDistributions obj's underlying member method code with example usage: obj.test_skewstudent(seed) without return types