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

# cogent.maths.stats.jackknife.JackknifeStats

All Samples(14)  |  Call(12)  |  Derive(0)  |  Import(2)

```import numpy as np
from cogent.util.unit_test import TestCase, main

from cogent.maths.stats.jackknife import JackknifeStats

```
```    def test_proper_initialise(self):
"""jackknife should initialise correctly"""
# Scalar
pmcc_stat = stat_maker(pmcc, data, 1)
test_knife = JackknifeStats(data.shape[1], pmcc_stat)
```
```        # Vector
mean_stat = stat_maker(mean, data, 1)
test_knife = JackknifeStats(data.shape[1], mean_stat)
self.assertEqual(test_knife.n, data.shape[1])
self.assertEqual(test_knife._jackknifed_stat, None)
```
```    def test_jackknife_stats(self):
"""jackknife results should match Sokal & Rolf example"""
# Scalar
pmcc_stat = stat_maker(pmcc, data, 1)
test_knife = JackknifeStats(data.shape[1], pmcc_stat)
```
```        # Vector
mean_stat = stat_maker(mean, data, 1)
test_knife = JackknifeStats(data.shape[1], mean_stat)
expected_jk_stat = data.mean(axis=1)
got_jk_stat = test_knife.JackknifedStat
```

```import numpy as np
from cogent.util.unit_test import TestCase, main

from cogent.maths.stats.jackknife import JackknifeStats

```
```    def test_proper_initialise(self):
"""jackknife should initialise correctly"""
# Scalar
pmcc_stat = stat_maker(pmcc, data, 1)
test_knife = JackknifeStats(data.shape[1], pmcc_stat)
```
```        # Vector
mean_stat = stat_maker(mean, data, 1)
test_knife = JackknifeStats(data.shape[1], mean_stat)
self.assertEqual(test_knife.n, data.shape[1])
self.assertEqual(test_knife._jackknifed_stat, None)
```
```    def test_jackknife_stats(self):
"""jackknife results should match Sokal & Rolf example"""
# Scalar
pmcc_stat = stat_maker(pmcc, data, 1)
test_knife = JackknifeStats(data.shape[1], pmcc_stat)
```
```        # Vector
mean_stat = stat_maker(mean, data, 1)
test_knife = JackknifeStats(data.shape[1], mean_stat)
expected_jk_stat = data.mean(axis=1)
got_jk_stat = test_knife.JackknifedStat
```