Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# cogent.maths.stats.special.igami

All Samples(12)  |  Call(8)  |  Derive(0)  |  Import(4)

```"""
from __future__ import division
from cogent.maths.stats.special import erf, erfc, igamc, igam, betai, log1p, \
expm1, SQRTH, MACHEP, MAXNUM, PI, ndtri, incbi, igami, fix_rounding_error,\
ln_binomial
```
```    if(y < 0.0 or y > 1.0 or df < 1.0):
raise ZeroDivisionError, "y must be between 0 and 1; df >= 1"
return 2 * igami(0.5*df, y)

def stdtri(k, p):
```
```        raise ZeroDivisionError, "k must be >=0, p between 1 and 0."
v = k+1;
return igami(v, p)

def bdtri(k, n, y):
```
```    if y < 0.0 or y > 1.0 or a <= 0.0 or b < 0.0:
raise ZeroDivisionError, "a and b must be non-negative, y from 0 to 1."
return igami(b, 1.0-y) / a

def fdtri(a, b, y):
```

```"""
from __future__ import division
from cogent.maths.stats.special import erf, erfc, igamc, igam, betai, log1p, \
expm1, SQRTH, MACHEP, MAXNUM, PI, ndtri, incbi, igami, fix_rounding_error,\
ln_binomial
```
```    if(y < 0.0 or y > 1.0 or df < 1.0):
raise ZeroDivisionError, "y must be between 0 and 1; df >= 1"
return 2 * igami(0.5*df, y)

def stdtri(k, p):
```
```        raise ZeroDivisionError, "k must be >=0, p between 1 and 0."
v = k+1;
return igami(v, p)

def bdtri(k, n, y):
```
```    if y < 0.0 or y > 1.0 or a <= 0.0 or b < 0.0:
raise ZeroDivisionError, "a and b must be non-negative, y from 0 to 1."
return igami(b, 1.0-y) / a

def fdtri(a, b, y):
```

```#!/usr/bin/env python
"""Unit tests for special functions used in statistics.
"""
from cogent.util.unit_test import TestCase, main
from cogent.maths.stats.special import permutations, permutations_exact, \
```
```    def test_igami(self):
"""igami should give same result as cephes implementation"""
a_vals = [1e-10, 1e-5, 0.5, 1, 10, 200]
y_vals = range(0,10,2)
obs = [igami(a, y/10.0) for a in a_vals for y in y_vals]
```

```#!/usr/bin/env python
"""Unit tests for special functions used in statistics.
"""
from cogent.util.unit_test import TestCase, main
from cogent.maths.stats.special import permutations, permutations_exact, \
```
```    def test_igami(self):
"""igami should give same result as cephes implementation"""
a_vals = [1e-10, 1e-5, 0.5, 1, 10, 200]
y_vals = range(0,10,2)
obs = [igami(a, y/10.0) for a in a_vals for y in y_vals]
```