Bootstrap export/import (#198)

* feat: export_bootstrap method added.

* feat: import_bootstrap function added.

* tests: first test for import/export bootstrap added.

* feat: bootstrap feature cleaned up.

* docs: boostrap docstrings improved.
This commit is contained in:
Fabian Joswig 2023-07-14 13:12:11 +01:00 committed by GitHub
parent 2cd076dbd7
commit b62a18643e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 88 additions and 0 deletions

View file

@ -1094,6 +1094,20 @@ def test_import_jackknife():
assert my_obs == reconstructed_obs
def test_import_bootstrap():
seed = 4321
samples = 1234
length = 820
name = "test"
rng = np.random.default_rng(seed)
random_numbers = rng.integers(0, length, size=(samples, length))
obs = pe.pseudo_Obs(2.447, 0.14, name, length)
boots = obs.export_bootstrap(1234, random_numbers=random_numbers)
re_obs = pe.import_bootstrap(boots, name, random_numbers=random_numbers)
assert obs == re_obs
def test_reduce_deltas():
idx_old = range(1, 101)
deltas = [float(i) for i in idx_old]