def test_pdf(self): """Test pdf method.""" skewt = SkewStudent() num = 50 arg = np.linspace(-1, 1, num) pdf = skewt.pdf(arg) self.assertEqual(pdf.shape[0], num) self.assertIsInstance(skewt.pdf(0), float)
def test_compare_with_t(self): """Compare with standard t distribution.""" eta = 5 skewt = SkewStudent(eta=eta, lam=0) scale = 1/(eta/(eta-2))**.5 standt = t(eta, scale=scale) arg = np.linspace(-2, 2, 100) np.testing.assert_array_almost_equal(skewt.pdf(arg), standt.pdf(arg)) np.testing.assert_array_almost_equal(skewt.cdf(arg), standt.cdf(arg)) arg = np.linspace(.01, .99, 100) np.testing.assert_array_almost_equal(skewt.ppf(arg), standt.ppf(arg))
def test_compare_with_t(self): """Compare with standard t distribution.""" eta = 5 skewt = SkewStudent(eta=eta, lam=0) scale = 1 / (eta / (eta - 2))**.5 standt = t(eta, scale=scale) arg = np.linspace(-2, 2, 100) np.testing.assert_array_almost_equal(skewt.pdf(arg), standt.pdf(arg)) np.testing.assert_array_almost_equal(skewt.cdf(arg), standt.cdf(arg)) arg = np.linspace(.01, .99, 100) np.testing.assert_array_almost_equal(skewt.ppf(arg), standt.ppf(arg))