def test_ppf(self): """Test ppf method.""" skewt = SkewStudent() num = 50 arg = np.linspace(.01, .99, num) ppf = skewt.ppf(arg) self.assertEqual(ppf.shape[0], num) self.assertIsInstance(skewt.ppf(.5), 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))