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

# cogent.maths.stats.period.blockwise_bootstrap

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

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

from cogent.maths.stats.period import chi_square, factorial, g_statistic, \
circular_indices, _seq_to_symbols, seq_to_symbols, blockwise_bootstrap, \
```
```        hybrid_calc = Hybrid(len(s), llim=2, period = 4)
ipdft_calc = Ipdft(len(s), llim=2, period = 4)
stat, p = blockwise_bootstrap(s, hybrid_calc, block_size=10,
num_reps=1000, seq_to_symbols=seq_to_symbol)
# print 's=%.4f; p=%.3f' % (stat, p)
stat, p = blockwise_bootstrap(s, ipdft_calc, block_size=10,
```
```        seq_to_symbol = SeqToSymbols(self.motifs, length=len(s))
hybrid_calc = Hybrid(len(s), period = 4, return_all=True)
stat, p = blockwise_bootstrap(s, hybrid_calc, block_size=10,
num_reps=1000, seq_to_symbols=seq_to_symbol)
# print 's=%s; p=%s' % (stat, p)
```
```        seq_to_symbol = SeqToSymbols(self.motifs, length=len(s))
ipdft_calc = Ipdft(len(s), llim=2, period = 4)
stat, p = blockwise_bootstrap(s, ipdft_calc, block_size=10,
num_reps=1000, seq_to_symbols=seq_to_symbol, num_stats=1)
self.assertEqual(stat, 0.0)
```

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

from cogent.maths.stats.period import chi_square, factorial, g_statistic, \
circular_indices, _seq_to_symbols, seq_to_symbols, blockwise_bootstrap, \
```
```        hybrid_calc = Hybrid(len(s), llim=2, period = 4)
ipdft_calc = Ipdft(len(s), llim=2, period = 4)
stat, p = blockwise_bootstrap(s, hybrid_calc, block_size=10,
num_reps=1000, seq_to_symbols=seq_to_symbol)
# print 's=%.4f; p=%.3f' % (stat, p)
stat, p = blockwise_bootstrap(s, ipdft_calc, block_size=10,
```
```        seq_to_symbol = SeqToSymbols(self.motifs, length=len(s))
hybrid_calc = Hybrid(len(s), period = 4, return_all=True)
stat, p = blockwise_bootstrap(s, hybrid_calc, block_size=10,
num_reps=1000, seq_to_symbols=seq_to_symbol)
# print 's=%s; p=%s' % (stat, p)
```
```        seq_to_symbol = SeqToSymbols(self.motifs, length=len(s))
ipdft_calc = Ipdft(len(s), llim=2, period = 4)
stat, p = blockwise_bootstrap(s, ipdft_calc, block_size=10,
num_reps=1000, seq_to_symbols=seq_to_symbol, num_stats=1)
self.assertEqual(stat, 0.0)
```