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

# cogent.maths.stats.special.combinations

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

```from numpy import sqrt, log, pi, exp, fabs, floor, zeros, asarray,\
dot as matrixmultiply, ones, array, reshape, ravel, sum, arange
from cogent.maths.stats.special import combinations

__author__ = "Gavin Huttley"
```
```    to = floor(n * (1-statistic))+1
j = arange(0, to)
coeffs = asarray([log(combinations(n, i)) for i in j])
p = sum(exp(coeffs + (n-j)*log(1-statistic-j/n) + \
(j-1)*(log(statistic+j/n))))
```

```from numpy import sqrt, log, pi, exp, fabs, floor, zeros, asarray,\
dot as matrixmultiply, ones, array, reshape, ravel, sum, arange
from cogent.maths.stats.special import combinations

__author__ = "Gavin Huttley"
```
```    to = floor(n * (1-statistic))+1
j = arange(0, to)
coeffs = asarray([log(combinations(n, i)) for i in j])
p = sum(exp(coeffs + (n-j)*log(1-statistic-j/n) + \
(j-1)*(log(statistic+j/n))))
```

```#!/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, \
```
```        previous_value = 252.00001
while start <= end:
obs = combinations(10,start)
assert lower_lim <= obs <= upper_lim
assert obs < previous_value
```

```#!/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, \
```
```        previous_value = 252.00001
while start <= end:
obs = combinations(10,start)
assert lower_lim <= obs <= upper_lim
assert obs < previous_value
```