code: def test_studentst(self, seed):
      dist = StudentsT(seed=seed)
      v = 4.0
      ll1 = dist.loglikelihood(np.array([v]), self.resids, self.sigma2)
      # Direct calculation of PDF, then log
      constant = np.exp(gammaln(0.5 * (v + 1)) - gammaln(0.5 * v))
      pdf = constant / np.sqrt(np.pi * (v - 2) * self.sigma2)
      pdf *= (1 + self.resids**2.0 / (self.sigma2 * (v - 2))) ** (
          -(v + 1) / 2
      )
      ll2 = np.log(pdf).sum()
      assert_almost_equal(ll1, ll2)
  
      assert_equal(dist.num_params, 1)
  
      bounds = dist.bounds(self.resids)
      assert_equal(len(bounds), 1)
  
      a, b = dist.constraints()
      assert_equal(a.shape, (2, 1))
  
      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])
      )
  
      with pytest.raises(ValueError):
          dist.simulate(np.array([1.5]))
      sim = dist.simulate(8.0)
      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 3 for calling the TestDistributions obj's underlying member method code with example usage: obj.test_studentst(seed) without return types