Python scipy.special.stdtr() Examples

The following are 13 code examples of scipy.special.stdtr(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module scipy.special , or try the search function .
Example #1
Source File: _continuous_distns.py    From lambda-packs with MIT License 5 votes vote down vote up
def _cdf(self, x, df):
        return sc.stdtr(df, x) 
Example #2
Source File: _continuous_distns.py    From lambda-packs with MIT License 5 votes vote down vote up
def _sf(self, x, df):
        return sc.stdtr(df, -x) 
Example #3
Source File: _continuous_distns.py    From GraphicDesignPatternByPython with MIT License 5 votes vote down vote up
def _cdf(self, x, df):
        return sc.stdtr(df, x) 
Example #4
Source File: _continuous_distns.py    From GraphicDesignPatternByPython with MIT License 5 votes vote down vote up
def _sf(self, x, df):
        return sc.stdtr(df, -x) 
Example #5
Source File: test_cdflib.py    From GraphicDesignPatternByPython with MIT License 5 votes vote down vote up
def test_stdtr(self):
        # Ideally the left endpoint for Arg() should be 0.
        assert_mpmath_equal(
            sp.stdtr,
            _student_t_cdf,
            [IntArg(1, 100), Arg(1e-10, np.inf)], rtol=1e-7) 
Example #6
Source File: distribution.py    From Conditional_Density_Estimation with MIT License 5 votes vote down vote up
def batched_univ_t_cdf(x, loc, scale, dof):
  x, loc, scale, dof = np.squeeze(x), np.squeeze(loc), np.squeeze(scale), np.squeeze(dof)
  assert x.shape == loc.shape == scale.shape == dof.shape and x.ndim == 1
  x_norm = (x - loc) / scale
  p = stdtr(dof, x_norm)
  return p 
Example #7
Source File: _continuous_distns.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def _cdf(self, x, df):
        return sc.stdtr(df, x) 
Example #8
Source File: _continuous_distns.py    From Splunking-Crime with GNU Affero General Public License v3.0 5 votes vote down vote up
def _sf(self, x, df):
        return sc.stdtr(df, -x) 
Example #9
Source File: t_copula.py    From chaospy with MIT License 5 votes vote down vote up
def _cdf(self, x, df, C, Ci):
        out = special.stdtr(df, numpy.dot(Ci, special.stdtrit(df, x)))
        return out 
Example #10
Source File: t_copula.py    From chaospy with MIT License 5 votes vote down vote up
def _ppf(self, q, df, C, Ci):
        out = special.stdtr(df, numpy.dot(C, special.stdtrit(df, q)))
        return out 
Example #11
Source File: mv_student_t.py    From chaospy with MIT License 5 votes vote down vote up
def _cdf(self, x, a, C, Ci, loc):
        x = numpy.dot(Ci, (x.T-loc.T).T)
        return special.stdtr(a, x) 
Example #12
Source File: student_t.py    From chaospy with MIT License 5 votes vote down vote up
def _cdf(self, x, a):
        return special.stdtr(a, x) 
Example #13
Source File: test_cdflib.py    From GraphicDesignPatternByPython with MIT License 4 votes vote down vote up
def test_nonfinite():
    funcs = [
        ("btdtria", 3),
        ("btdtrib", 3),
        ("bdtrik", 3),
        ("bdtrin", 3),
        ("chdtriv", 2),
        ("chndtr", 3),
        ("chndtrix", 3),
        ("chndtridf", 3),
        ("chndtrinc", 3),
        ("fdtridfd", 3),
        ("ncfdtr", 4),
        ("ncfdtri", 4),
        ("ncfdtridfn", 4),
        ("ncfdtridfd", 4),
        ("ncfdtrinc", 4),
        ("gdtrix", 3),
        ("gdtrib", 3),
        ("gdtria", 3),
        ("nbdtrik", 3),
        ("nbdtrin", 3),
        ("nrdtrimn", 3),
        ("nrdtrisd", 3),
        ("pdtrik", 2),
        ("stdtr", 2),
        ("stdtrit", 2),
        ("stdtridf", 2),
        ("nctdtr", 3),
        ("nctdtrit", 3),
        ("nctdtridf", 3),
        ("nctdtrinc", 3),
        ("tklmbda", 2),
    ]

    np.random.seed(1)

    for func, numargs in funcs:
        func = getattr(sp, func)

        args_choices = [(float(x), np.nan, np.inf, -np.inf) for x in
                        np.random.rand(numargs)]

        for args in itertools.product(*args_choices):
            res = func(*args)

            if any(np.isnan(x) for x in args):
                # Nan inputs should result to nan output
                assert_equal(res, np.nan)
            else:
                # All other inputs should return something (but not
                # raise exceptions or cause hangs)
                pass