tsbootstrap 0.0.1__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/PKG-INFO +23 -21
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/README.md +21 -18
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/pyproject.toml +3 -3
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/base_bootstrap_configs.py +0 -1
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/block_bootstrap.py +0 -124
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/block_bootstrap_configs.py +2 -4
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/block_length_sampler.py +0 -1
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/tsfit.py +0 -1
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/LICENSE +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/__init__.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/base_bootstrap.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/block_generator.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/block_resampler.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/bootstrap.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/markov_sampler.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/py.typed +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/ranklags.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/time_series_model.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/time_series_simulator.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/utils/odds_and_ends.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/utils/types.py +0 -0
- {tsbootstrap-0.0.1 → tsbootstrap-0.0.3}/src/tsbootstrap/utils/validate.py +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tsbootstrap
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3
|
|
4
4
|
Summary: A Python package to generate bootstrapped time series
|
|
5
|
+
Home-page: https://tsbootstrap.readthedocs.io/en/latest/
|
|
5
6
|
License: MIT
|
|
6
7
|
Author: Sankalp Gilda
|
|
7
8
|
Author-email: sankalp.gilda@gmail.com
|
|
@@ -24,15 +25,14 @@ Requires-Dist: numba (>=0.57,<0.58)
|
|
|
24
25
|
Requires-Dist: pyclustering (>=0.10,<0.11)
|
|
25
26
|
Requires-Dist: scikit_learn_extra (>=0.3,<0.4)
|
|
26
27
|
Requires-Dist: scipy (>=1.10,<1.11)
|
|
27
|
-
Requires-Dist: sphinx (>=7.1.2,<8.0.0)
|
|
28
|
-
Requires-Dist: sphinx-rtd-theme (>=1.2.2,<2.0.0)
|
|
29
28
|
Description-Content-Type: text/markdown
|
|
30
29
|
|
|
31
30
|
<div align="center">
|
|
32
|
-
<
|
|
31
|
+
<div style="float: left; margin-right: 20px;">
|
|
33
32
|
<img src="https://github.com/astrogilda/tsbootstrap/blob/main/tsbootstrap_logo.png" width="120" />
|
|
34
|
-
</
|
|
35
|
-
<h3
|
|
33
|
+
</div>
|
|
34
|
+
<h3>Generate bootstrapped samples from time-series data. The full documentation is available <a href="https://tsbootstrap.readthedocs.io/en/latest/">here</a>.</h3>
|
|
35
|
+
<div style="clear: both;"></div>
|
|
36
36
|
<br>
|
|
37
37
|
<p align="center">
|
|
38
38
|
<img src="https://img.shields.io/badge/Markdown-000000.svg?stylee&logo=Markdown&logoColor=white" alt="Markdown" />
|
|
@@ -51,14 +51,14 @@ Description-Content-Type: text/markdown
|
|
|
51
51
|
<img src="https://img.shields.io/pypi/pyversions/tsbootstrap?color=5D6D7E&logo=python" alt="pypi-python-version" />
|
|
52
52
|
</a>
|
|
53
53
|
<a href="https://pypi.org/project/tsbootstrap/">
|
|
54
|
-
<img src="https://img.shields.io/pypi/
|
|
54
|
+
<img src="https://img.shields.io/pypi/dd/tsbootstrap?color=5D6D7E" alt="pypi-downloads" />
|
|
55
55
|
</a>
|
|
56
56
|
<img src="https://img.shields.io/github/license/eli64s/readme-ai?color=5D6D7E" alt="github-license" />
|
|
57
57
|
</a>
|
|
58
58
|
<img src="https://github.com/astrogilda/tsbootstrap/workflows/CI/badge.svg" alt="Build Status"/>
|
|
59
59
|
<a href="https://codecov.io/gh/astrogilda/tsbootstrap"><img src="https://codecov.io/gh/astrogilda/tsbootstrap/branch/main/graph/badge.svg" alt="codecov"/></a>
|
|
60
60
|
<a href="https://doi.org/10.5281/zenodo.8226496"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.8226496.svg" alt="DOI"/></a>
|
|
61
|
-
<img src="https://
|
|
61
|
+
<a href="https://codeclimate.com/github/astrogilda/tsbootstrap/maintainability"><img src="https://api.codeclimate.com/v1/badges/d80a0615a8c00f31565c/maintainability" alt="Code Quality"/></a>
|
|
62
62
|
<img src="https://img.shields.io/github/last-commit/astrogilda/tsbootstrap" alt="Last Commit"/>
|
|
63
63
|
<img src="https://img.shields.io/github/issues/astrogilda/tsbootstrap" alt="Issues"/>
|
|
64
64
|
<img src="https://img.shields.io/github/issues-pr/astrogilda/tsbootstrap" alt="Pull Requests"/>
|
|
@@ -165,17 +165,19 @@ The `tsbootstrap` package contains various modules that handle tasks such as boo
|
|
|
165
165
|
|
|
166
166
|
| File | Summary |
|
|
167
167
|
| --- | --- |
|
|
168
|
-
| [setup.sh](https://github.com/astrogilda/tsbootstrap/blob/main/setup.sh) |
|
|
169
|
-
| [commitlint.config.js](https://github.com/astrogilda/tsbootstrap/blob/main/commitlint.config.js) |
|
|
170
|
-
| [CITATION.cff](https://github.com/astrogilda/tsbootstrap/blob/main/CITATION.cff) |
|
|
171
|
-
| [CODE_OF_CONDUCT.md](https://github.com/astrogilda/tsbootstrap/blob/main/CODE_OF_CONDUCT.md) |
|
|
172
|
-
| [CONTRIBUTING.md](https://github.com/astrogilda/tsbootstrap/blob/main/CITATION.md) |
|
|
173
|
-
| [.codeclimate.yml](https://github.com/astrogilda/tsbootstrap/blob/main/.codeclimate.yml) |
|
|
174
|
-
| [.gitignore](https://github.com/astrogilda/tsbootstrap/blob/main/.gitignore) |
|
|
175
|
-
| [.pre-commit-config.yaml](https://github.com/astrogilda/tsbootstrap/blob/main/.pre-commit-config.yaml) |
|
|
176
|
-
| [poetry.lock](https://github.com/astrogilda/tsbootstrap/blob/main/poetry.lock) |
|
|
177
|
-
| [poetry.toml](https://github.com/astrogilda/tsbootstrap/blob/main/poetry.toml) |
|
|
178
|
-
| [tsbootstrap_logo.png](https://github.com/astrogilda/tsbootstrap/blob/main/tsbootstrap_logo.png) |
|
|
168
|
+
| [setup.sh](https://github.com/astrogilda/tsbootstrap/blob/main/setup.sh) | Shell script for initial setup and environment configuration. |
|
|
169
|
+
| [commitlint.config.js](https://github.com/astrogilda/tsbootstrap/blob/main/commitlint.config.js) | Configuration for enforcing conventional commit messages. |
|
|
170
|
+
| [CITATION.cff](https://github.com/astrogilda/tsbootstrap/blob/main/CITATION.cff) | Citation metadata for the project. |
|
|
171
|
+
| [CODE_OF_CONDUCT.md](https://github.com/astrogilda/tsbootstrap/blob/main/CODE_OF_CONDUCT.md) | Guidelines for community conduct and interactions. |
|
|
172
|
+
| [CONTRIBUTING.md](https://github.com/astrogilda/tsbootstrap/blob/main/CITATION.md) | Instructions for contributing to the project. |
|
|
173
|
+
| [.codeclimate.yml](https://github.com/astrogilda/tsbootstrap/blob/main/.codeclimate.yml) | Configuration for Code Climate quality checks. |
|
|
174
|
+
| [.gitignore](https://github.com/astrogilda/tsbootstrap/blob/main/.gitignore) | Specifies files and folders to be ignored by Git. |
|
|
175
|
+
| [.pre-commit-config.yaml](https://github.com/astrogilda/tsbootstrap/blob/main/.pre-commit-config.yaml) | Configuration for pre-commit hooks. |
|
|
176
|
+
| [poetry.lock](https://github.com/astrogilda/tsbootstrap/blob/main/poetry.lock) | Lock file generated by Poetry, pinning exact package versions. |
|
|
177
|
+
| [poetry.toml](https://github.com/astrogilda/tsbootstrap/blob/main/poetry.toml) | Configuration file for Poetry package management. |
|
|
178
|
+
| [tsbootstrap_logo.png](https://github.com/astrogilda/tsbootstrap/blob/main/tsbootstrap_logo.png) | Project logo image. |
|
|
179
|
+
|
|
180
|
+
</details>
|
|
179
181
|
|
|
180
182
|
|
|
181
183
|
|
|
@@ -288,8 +290,8 @@ mbb_config = MovingBlockBootstrapConfig(
|
|
|
288
290
|
)
|
|
289
291
|
mbb = MovingBlockBootstrap(config=mbb_config)
|
|
290
292
|
|
|
291
|
-
# Generate 1000 bootstrapped samples
|
|
292
|
-
bootstrapped_samples = bootstrap.
|
|
293
|
+
# Generate the generator for 1000 bootstrapped samples
|
|
294
|
+
bootstrapped_samples = bootstrap.bootstrap(n=1000)
|
|
293
295
|
```
|
|
294
296
|
|
|
295
297
|
### 🧪 Running Tests
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<
|
|
2
|
+
<div style="float: left; margin-right: 20px;">
|
|
3
3
|
<img src="https://github.com/astrogilda/tsbootstrap/blob/main/tsbootstrap_logo.png" width="120" />
|
|
4
|
-
</
|
|
5
|
-
<h3
|
|
4
|
+
</div>
|
|
5
|
+
<h3>Generate bootstrapped samples from time-series data. The full documentation is available <a href="https://tsbootstrap.readthedocs.io/en/latest/">here</a>.</h3>
|
|
6
|
+
<div style="clear: both;"></div>
|
|
6
7
|
<br>
|
|
7
8
|
<p align="center">
|
|
8
9
|
<img src="https://img.shields.io/badge/Markdown-000000.svg?stylee&logo=Markdown&logoColor=white" alt="Markdown" />
|
|
@@ -21,14 +22,14 @@
|
|
|
21
22
|
<img src="https://img.shields.io/pypi/pyversions/tsbootstrap?color=5D6D7E&logo=python" alt="pypi-python-version" />
|
|
22
23
|
</a>
|
|
23
24
|
<a href="https://pypi.org/project/tsbootstrap/">
|
|
24
|
-
<img src="https://img.shields.io/pypi/
|
|
25
|
+
<img src="https://img.shields.io/pypi/dd/tsbootstrap?color=5D6D7E" alt="pypi-downloads" />
|
|
25
26
|
</a>
|
|
26
27
|
<img src="https://img.shields.io/github/license/eli64s/readme-ai?color=5D6D7E" alt="github-license" />
|
|
27
28
|
</a>
|
|
28
29
|
<img src="https://github.com/astrogilda/tsbootstrap/workflows/CI/badge.svg" alt="Build Status"/>
|
|
29
30
|
<a href="https://codecov.io/gh/astrogilda/tsbootstrap"><img src="https://codecov.io/gh/astrogilda/tsbootstrap/branch/main/graph/badge.svg" alt="codecov"/></a>
|
|
30
31
|
<a href="https://doi.org/10.5281/zenodo.8226496"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.8226496.svg" alt="DOI"/></a>
|
|
31
|
-
<img src="https://
|
|
32
|
+
<a href="https://codeclimate.com/github/astrogilda/tsbootstrap/maintainability"><img src="https://api.codeclimate.com/v1/badges/d80a0615a8c00f31565c/maintainability" alt="Code Quality"/></a>
|
|
32
33
|
<img src="https://img.shields.io/github/last-commit/astrogilda/tsbootstrap" alt="Last Commit"/>
|
|
33
34
|
<img src="https://img.shields.io/github/issues/astrogilda/tsbootstrap" alt="Issues"/>
|
|
34
35
|
<img src="https://img.shields.io/github/issues-pr/astrogilda/tsbootstrap" alt="Pull Requests"/>
|
|
@@ -135,17 +136,19 @@ The `tsbootstrap` package contains various modules that handle tasks such as boo
|
|
|
135
136
|
|
|
136
137
|
| File | Summary |
|
|
137
138
|
| --- | --- |
|
|
138
|
-
| [setup.sh](https://github.com/astrogilda/tsbootstrap/blob/main/setup.sh) |
|
|
139
|
-
| [commitlint.config.js](https://github.com/astrogilda/tsbootstrap/blob/main/commitlint.config.js) |
|
|
140
|
-
| [CITATION.cff](https://github.com/astrogilda/tsbootstrap/blob/main/CITATION.cff) |
|
|
141
|
-
| [CODE_OF_CONDUCT.md](https://github.com/astrogilda/tsbootstrap/blob/main/CODE_OF_CONDUCT.md) |
|
|
142
|
-
| [CONTRIBUTING.md](https://github.com/astrogilda/tsbootstrap/blob/main/CITATION.md) |
|
|
143
|
-
| [.codeclimate.yml](https://github.com/astrogilda/tsbootstrap/blob/main/.codeclimate.yml) |
|
|
144
|
-
| [.gitignore](https://github.com/astrogilda/tsbootstrap/blob/main/.gitignore) |
|
|
145
|
-
| [.pre-commit-config.yaml](https://github.com/astrogilda/tsbootstrap/blob/main/.pre-commit-config.yaml) |
|
|
146
|
-
| [poetry.lock](https://github.com/astrogilda/tsbootstrap/blob/main/poetry.lock) |
|
|
147
|
-
| [poetry.toml](https://github.com/astrogilda/tsbootstrap/blob/main/poetry.toml) |
|
|
148
|
-
| [tsbootstrap_logo.png](https://github.com/astrogilda/tsbootstrap/blob/main/tsbootstrap_logo.png) |
|
|
139
|
+
| [setup.sh](https://github.com/astrogilda/tsbootstrap/blob/main/setup.sh) | Shell script for initial setup and environment configuration. |
|
|
140
|
+
| [commitlint.config.js](https://github.com/astrogilda/tsbootstrap/blob/main/commitlint.config.js) | Configuration for enforcing conventional commit messages. |
|
|
141
|
+
| [CITATION.cff](https://github.com/astrogilda/tsbootstrap/blob/main/CITATION.cff) | Citation metadata for the project. |
|
|
142
|
+
| [CODE_OF_CONDUCT.md](https://github.com/astrogilda/tsbootstrap/blob/main/CODE_OF_CONDUCT.md) | Guidelines for community conduct and interactions. |
|
|
143
|
+
| [CONTRIBUTING.md](https://github.com/astrogilda/tsbootstrap/blob/main/CITATION.md) | Instructions for contributing to the project. |
|
|
144
|
+
| [.codeclimate.yml](https://github.com/astrogilda/tsbootstrap/blob/main/.codeclimate.yml) | Configuration for Code Climate quality checks. |
|
|
145
|
+
| [.gitignore](https://github.com/astrogilda/tsbootstrap/blob/main/.gitignore) | Specifies files and folders to be ignored by Git. |
|
|
146
|
+
| [.pre-commit-config.yaml](https://github.com/astrogilda/tsbootstrap/blob/main/.pre-commit-config.yaml) | Configuration for pre-commit hooks. |
|
|
147
|
+
| [poetry.lock](https://github.com/astrogilda/tsbootstrap/blob/main/poetry.lock) | Lock file generated by Poetry, pinning exact package versions. |
|
|
148
|
+
| [poetry.toml](https://github.com/astrogilda/tsbootstrap/blob/main/poetry.toml) | Configuration file for Poetry package management. |
|
|
149
|
+
| [tsbootstrap_logo.png](https://github.com/astrogilda/tsbootstrap/blob/main/tsbootstrap_logo.png) | Project logo image. |
|
|
150
|
+
|
|
151
|
+
</details>
|
|
149
152
|
|
|
150
153
|
|
|
151
154
|
|
|
@@ -258,8 +261,8 @@ mbb_config = MovingBlockBootstrapConfig(
|
|
|
258
261
|
)
|
|
259
262
|
mbb = MovingBlockBootstrap(config=mbb_config)
|
|
260
263
|
|
|
261
|
-
# Generate 1000 bootstrapped samples
|
|
262
|
-
bootstrapped_samples = bootstrap.
|
|
264
|
+
# Generate the generator for 1000 bootstrapped samples
|
|
265
|
+
bootstrapped_samples = bootstrap.bootstrap(n=1000)
|
|
263
266
|
```
|
|
264
267
|
|
|
265
268
|
### 🧪 Running Tests
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "tsbootstrap"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.3"
|
|
4
4
|
description = "A Python package to generate bootstrapped time series"
|
|
5
5
|
authors = ["Sankalp Gilda <sankalp.gilda@gmail.com>"]
|
|
6
6
|
license = "MIT"
|
|
@@ -19,6 +19,7 @@ packages = [
|
|
|
19
19
|
{ include = "tsbootstrap", from = "src" },
|
|
20
20
|
]
|
|
21
21
|
include = ["src/tsbootstrap/py.typed"]
|
|
22
|
+
homepage = "https://tsbootstrap.readthedocs.io/en/latest/"
|
|
22
23
|
|
|
23
24
|
[tool.poetry.dependencies]
|
|
24
25
|
python = ">=3.10,<3.12"
|
|
@@ -30,8 +31,6 @@ scikit_learn_extra = "~0.3"
|
|
|
30
31
|
cython = "~3.0"
|
|
31
32
|
importlib-metadata = "~6.8"
|
|
32
33
|
scipy = "~1.10"
|
|
33
|
-
sphinx = "^7.1.2"
|
|
34
|
-
sphinx-rtd-theme = "^1.2.2"
|
|
35
34
|
furo = "^2023.7.26"
|
|
36
35
|
|
|
37
36
|
[tool.poetry.dev-dependencies]
|
|
@@ -54,6 +53,7 @@ pycobertura = "~3.2"
|
|
|
54
53
|
[tool.poetry.group.dev.dependencies]
|
|
55
54
|
sphinx = "^7.1.2"
|
|
56
55
|
sphinx-rtd-theme = "^1.2.2"
|
|
56
|
+
bumpversion = "^0.6.0"
|
|
57
57
|
|
|
58
58
|
[build-system]
|
|
59
59
|
requires = ["poetry-core>=1.0.0"]
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from email.mime import base
|
|
4
3
|
from typing import TYPE_CHECKING
|
|
5
4
|
|
|
6
5
|
import numpy as np
|
|
@@ -281,15 +280,6 @@ class MovingBlockBootstrap(BlockBootstrap):
|
|
|
281
280
|
def __hash__(self) -> int:
|
|
282
281
|
return hash((super().__hash__(), self.config))
|
|
283
282
|
|
|
284
|
-
"""
|
|
285
|
-
def __getstate__(self) -> dict[str, object]:
|
|
286
|
-
return {
|
|
287
|
-
"config": self.config,
|
|
288
|
-
"blocks": self.blocks,
|
|
289
|
-
"block_resampler": self.block_resampler,
|
|
290
|
-
}
|
|
291
|
-
"""
|
|
292
|
-
|
|
293
283
|
|
|
294
284
|
class StationaryBlockBootstrap(BlockBootstrap):
|
|
295
285
|
r"""
|
|
@@ -343,20 +333,6 @@ class StationaryBlockBootstrap(BlockBootstrap):
|
|
|
343
333
|
def __hash__(self) -> int:
|
|
344
334
|
return hash((super().__hash__(), self.config))
|
|
345
335
|
|
|
346
|
-
"""
|
|
347
|
-
def __getstate__(self) -> dict[str, object]:
|
|
348
|
-
return {
|
|
349
|
-
"config": self.config,
|
|
350
|
-
"blocks": self.blocks,
|
|
351
|
-
"block_resampler": self.block_resampler,
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
def __setstate__(self, state: dict[str, object]) -> None:
|
|
355
|
-
self.config = state["config"]
|
|
356
|
-
self.blocks = state["blocks"]
|
|
357
|
-
self.block_resampler = state["block_resampler"]
|
|
358
|
-
"""
|
|
359
|
-
|
|
360
336
|
|
|
361
337
|
class CircularBlockBootstrap(BlockBootstrap):
|
|
362
338
|
r"""
|
|
@@ -413,20 +389,6 @@ class CircularBlockBootstrap(BlockBootstrap):
|
|
|
413
389
|
def __hash__(self) -> int:
|
|
414
390
|
return hash((super().__hash__(), self.config))
|
|
415
391
|
|
|
416
|
-
"""
|
|
417
|
-
def __getstate__(self) -> dict[str, object]:
|
|
418
|
-
return {
|
|
419
|
-
"config": self.config,
|
|
420
|
-
"blocks": self.blocks,
|
|
421
|
-
"block_resampler": self.block_resampler,
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
def __setstate__(self, state: dict[str, object]) -> None:
|
|
425
|
-
self.config = state["config"]
|
|
426
|
-
self.blocks = state["blocks"]
|
|
427
|
-
self.block_resampler = state["block_resampler"]
|
|
428
|
-
"""
|
|
429
|
-
|
|
430
392
|
|
|
431
393
|
class NonOverlappingBlockBootstrap(BlockBootstrap):
|
|
432
394
|
r"""
|
|
@@ -485,20 +447,6 @@ class NonOverlappingBlockBootstrap(BlockBootstrap):
|
|
|
485
447
|
def __hash__(self) -> int:
|
|
486
448
|
return hash((super().__hash__(), self.config))
|
|
487
449
|
|
|
488
|
-
"""
|
|
489
|
-
def __getstate__(self) -> dict[str, object]:
|
|
490
|
-
return {
|
|
491
|
-
"config": self.config,
|
|
492
|
-
"blocks": self.blocks,
|
|
493
|
-
"block_resampler": self.block_resampler,
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
def __setstate__(self, state: dict[str, object]) -> None:
|
|
497
|
-
self.config = state["config"]
|
|
498
|
-
self.blocks = state["blocks"]
|
|
499
|
-
self.block_resampler = state["block_resampler"]
|
|
500
|
-
"""
|
|
501
|
-
|
|
502
450
|
|
|
503
451
|
# Be cautious when using the default windowing functions from numpy, as they drop to 0 at the edges.This could be particularly problematic for smaller block_lengths. In the current implementation, we have clipped the min to 0.1, in block_resampler.py.
|
|
504
452
|
|
|
@@ -534,18 +482,6 @@ class BartlettsBootstrap(BaseBlockBootstrap):
|
|
|
534
482
|
def __hash__(self) -> int:
|
|
535
483
|
return hash((super().__hash__(), self.config))
|
|
536
484
|
|
|
537
|
-
"""
|
|
538
|
-
def __getstate__(self) -> dict[str, object]:
|
|
539
|
-
return {
|
|
540
|
-
"config": self.config,
|
|
541
|
-
"bootstrap_instance": self.bootstrap_instance,
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
def __setstate__(self, state: dict[str, object]) -> None:
|
|
545
|
-
self.config = state["config"]
|
|
546
|
-
self.bootstrap_instance = state["bootstrap_instance"]
|
|
547
|
-
"""
|
|
548
|
-
|
|
549
485
|
|
|
550
486
|
class HammingBootstrap(BaseBlockBootstrap):
|
|
551
487
|
r"""
|
|
@@ -592,18 +528,6 @@ class HammingBootstrap(BaseBlockBootstrap):
|
|
|
592
528
|
def __hash__(self) -> int:
|
|
593
529
|
return hash((super().__hash__(), self.config))
|
|
594
530
|
|
|
595
|
-
"""
|
|
596
|
-
def __getstate__(self) -> dict[str, object]:
|
|
597
|
-
return {
|
|
598
|
-
"config": self.config,
|
|
599
|
-
"bootstrap_instance": self.bootstrap_instance,
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
def __setstate__(self, state: dict[str, object]) -> None:
|
|
603
|
-
self.config = state["config"]
|
|
604
|
-
self.bootstrap_instance = state["bootstrap_instance"]
|
|
605
|
-
"""
|
|
606
|
-
|
|
607
531
|
|
|
608
532
|
class HanningBootstrap(BaseBlockBootstrap):
|
|
609
533
|
r"""
|
|
@@ -650,22 +574,6 @@ class HanningBootstrap(BaseBlockBootstrap):
|
|
|
650
574
|
def __hash__(self) -> int:
|
|
651
575
|
return hash((super().__hash__(), self.config))
|
|
652
576
|
|
|
653
|
-
"""
|
|
654
|
-
def __getstate__(self) -> dict[str, object]:
|
|
655
|
-
return {
|
|
656
|
-
"config": self.config,
|
|
657
|
-
"bootstrap_instance": self.bootstrap_instance,
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
def __setstate__(self, state: dict[str, object]) -> None:
|
|
661
|
-
if ["config", "bootstrap_instance"] != state.keys():
|
|
662
|
-
raise ValueError(
|
|
663
|
-
"The state dictionary must contain the keys 'config' and 'bootstrap_instance'."
|
|
664
|
-
)
|
|
665
|
-
self.config = state["config"]
|
|
666
|
-
self.bootstrap_instance = state["bootstrap_instance"]
|
|
667
|
-
"""
|
|
668
|
-
|
|
669
577
|
|
|
670
578
|
class BlackmanBootstrap(BaseBlockBootstrap):
|
|
671
579
|
r"""
|
|
@@ -712,22 +620,6 @@ class BlackmanBootstrap(BaseBlockBootstrap):
|
|
|
712
620
|
def __hash__(self) -> int:
|
|
713
621
|
return hash((super().__hash__(), self.config))
|
|
714
622
|
|
|
715
|
-
"""
|
|
716
|
-
def __getstate__(self) -> dict[str, object]:
|
|
717
|
-
return {
|
|
718
|
-
"config": self.config,
|
|
719
|
-
"bootstrap_instance": self.bootstrap_instance,
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
def __setstate__(self, state: dict[str, object]) -> None:
|
|
723
|
-
if ["config", "bootstrap_instance"] != state.keys():
|
|
724
|
-
raise ValueError(
|
|
725
|
-
"The state dictionary must contain the keys 'config' and 'bootstrap_instance'."
|
|
726
|
-
)
|
|
727
|
-
self.config = state["config"]
|
|
728
|
-
self.bootstrap_instance = state["bootstrap_instance"]
|
|
729
|
-
"""
|
|
730
|
-
|
|
731
623
|
|
|
732
624
|
class TukeyBootstrap(BaseBlockBootstrap):
|
|
733
625
|
r"""
|
|
@@ -775,22 +667,6 @@ class TukeyBootstrap(BaseBlockBootstrap):
|
|
|
775
667
|
def __hash__(self) -> int:
|
|
776
668
|
return hash((super().__hash__(), self.config))
|
|
777
669
|
|
|
778
|
-
"""
|
|
779
|
-
def __getstate__(self) -> dict[str, object]:
|
|
780
|
-
return {
|
|
781
|
-
"config": self.config,
|
|
782
|
-
"bootstrap_instance": self.bootstrap_instance,
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
def __setstate__(self, state: dict[str, object]) -> None:
|
|
786
|
-
if ["config", "bootstrap_instance"] != state.keys():
|
|
787
|
-
raise ValueError(
|
|
788
|
-
"The state dictionary must contain the keys 'config' and 'bootstrap_instance'."
|
|
789
|
-
)
|
|
790
|
-
self.config = state["config"]
|
|
791
|
-
self.bootstrap_instance = state["bootstrap_instance"]
|
|
792
|
-
"""
|
|
793
|
-
|
|
794
670
|
|
|
795
671
|
BLOCK_BOOTSTRAP_TYPES_DICT = {
|
|
796
672
|
"nonoverlapping": NonOverlappingBlockBootstrap,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from collections.abc import Callable
|
|
4
|
-
from email.mime import base
|
|
5
4
|
from functools import partial
|
|
6
5
|
from numbers import Integral
|
|
7
6
|
|
|
@@ -862,8 +861,6 @@ class TukeyBootstrapConfig(BaseBlockBootstrapConfig):
|
|
|
862
861
|
`tapered_weights` to Tukey window and `bootstrap_type` to "moving".
|
|
863
862
|
"""
|
|
864
863
|
|
|
865
|
-
tukey_alpha = staticmethod(partial(tukey, alpha=0.5))
|
|
866
|
-
|
|
867
864
|
def __init__(
|
|
868
865
|
self,
|
|
869
866
|
block_length: None | Integral = None,
|
|
@@ -889,8 +886,9 @@ class TukeyBootstrapConfig(BaseBlockBootstrapConfig):
|
|
|
889
886
|
super().__init__(block_length=block_length, **kwargs)
|
|
890
887
|
|
|
891
888
|
# Set the properties directly
|
|
889
|
+
alpha = kwargs.get("alpha", 0.5)
|
|
892
890
|
self._bootstrap_type = "moving"
|
|
893
|
-
self._tapered_weights =
|
|
891
|
+
self._tapered_weights = partial(tukey, alpha=alpha)
|
|
894
892
|
|
|
895
893
|
def __repr__(self) -> str:
|
|
896
894
|
"""Return repr(self)."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|