Example #1
0
    def test_cdf(self):
        """Test cdf."""

        eta = 20
        ndim = 3
        mvst = MvSt(ndim=ndim, eta=eta)
        cdf = mvst.cdf(np.zeros(1))

        self.assertIsInstance(cdf, float)

        eta = 20
        mvst = MvSt(ndim=ndim, eta=eta)
        cdf = mvst.cdf(np.zeros(ndim) - 10)

        self.assertIsInstance(cdf, float)
Example #2
0
    def test_cdf(self):
        """Test cdf."""

        eta = 20
        ndim = 3
        mvst = MvSt(ndim=ndim, eta=eta)
        cdf = mvst.cdf(np.zeros(1))

        self.assertIsInstance(cdf, float)

        eta = 20
        mvst = MvSt(ndim=ndim, eta=eta)
        cdf = mvst.cdf(np.zeros(ndim) - 10)

        self.assertIsInstance(cdf, float)
Example #3
0
    def test_quantile(self):
        """Test quantile."""

        eta = 20
        ndim = 1
        mvst = MvSt(ndim=ndim, eta=eta)
        arg = -2.
        cdf = mvst.cdf(arg)
        ppf = mvst.ppf(cdf)

        self.assertAlmostEqual(ppf, arg)

        arg = -.1 * np.ones(ndim)
        cdf = mvst.cdf_vec(arg)
        quantiles = mvst.ppf_vec(cdf)

        npt.assert_array_almost_equal(arg, quantiles)
Example #4
0
    def test_quantile(self):
        """Test quantile."""

        eta = 20
        ndim = 1
        mvst = MvSt(ndim=ndim, eta=eta)
        arg = -2.0
        cdf = mvst.cdf(arg)
        ppf = mvst.ppf(cdf)

        self.assertAlmostEqual(ppf, arg)

        arg = -0.1 * np.ones(ndim)
        cdf = mvst.cdf_vec(arg)
        quantiles = mvst.ppf_vec(cdf)

        npt.assert_array_almost_equal(arg, quantiles)