Python API reference¶
Generated with mkdocstrings from package docstrings.
Install the package and docs extras: pip install -e ".[docs]".
Runner¶
lrdbench.runner.BenchmarkRunner
¶
Orchestrate a complete benchmark run.
The runner implements the full benchmark loop:
- Load and validate the manifest.
- Materialise records from generators or observational sources.
- Optionally train data-driven estimators.
- Fit every enrolled estimator to every record.
- Evaluate mode-appropriate metrics.
- Build leaderboards.
- Persist results to a :class:
CsvResultStore. - Generate HTML/CSV/LaTeX report artefacts.
Example::
from lrdbench.runner import BenchmarkRunner
from lrdbench.manifest import load_manifest
runner = BenchmarkRunner()
manifest = load_manifest("my_suite.yaml")
output = runner.run(manifest)
print(output.run_id)
Source code in src/lrdbench/runner.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | |
run(manifest, *, manifest_path=None, base_dir=None)
¶
Execute the full benchmark loop for manifest.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifest
|
BenchmarkManifest
|
A validated :class: |
required |
manifest_path
|
Path | None
|
Path to the manifest file, used to resolve relative paths (e.g. observational CSV files). |
None
|
base_dir
|
Path | None
|
Alternative directory for relative path resolution.
If |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
BenchmarkRunOutput
|
class: |
BenchmarkRunOutput
|
estimates, metrics, leaderboards, and report bundle. |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If the manifest mode is not supported. |
ValueError
|
If the manifest requests unsupported generator
parameters (e.g. ARFIMA with |
Source code in src/lrdbench/runner.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | |
preview(manifest, *, manifest_path=None, base_dir=None)
¶
Dry-run preview: materialise records and report grid size without fitting.
Returns:
| Type | Description |
|---|---|
dict[str, object]
|
Dictionary with |
dict[str, object]
|
|
Source code in src/lrdbench/runner.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | |
__init__(*, generators=None, estimators=None, contaminations=None, discover_plugins=True)
¶
Source code in src/lrdbench/runner.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
lrdbench.runner.run_manifest_path(path, *, discover_plugins=True)
¶
Convenience entry-point: load a manifest from disk and run it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Filesystem path to a YAML manifest. |
required |
discover_plugins
|
bool
|
Whether to auto-discover third-party estimator plugins via environment variables. |
True
|
Returns:
| Type | Description |
|---|---|
BenchmarkRunOutput
|
The completed benchmark run output. |
Source code in src/lrdbench/runner.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 | |
lrdbench.runner.run_manifest_mapping(data, *, base_dir=None, discover_plugins=True)
¶
Convenience entry-point: run a benchmark from an in-memory dictionary.
This is useful for programmatic benchmark construction or testing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any]
|
Dictionary matching the manifest schema. |
required |
base_dir
|
Path | None
|
Directory used to resolve relative paths (e.g. CSV files). |
None
|
discover_plugins
|
bool
|
Whether to auto-discover third-party estimator plugins via environment variables. |
True
|
Returns:
| Type | Description |
|---|---|
BenchmarkRunOutput
|
The completed benchmark run output. |
Source code in src/lrdbench/runner.py
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 | |
Manifest¶
lrdbench.manifest.load_manifest(path)
¶
Source code in src/lrdbench/manifest.py
110 111 | |
lrdbench.manifest.manifest_from_mapping(data)
¶
Source code in src/lrdbench/manifest.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
Estimator interface¶
lrdbench.interfaces.BaseEstimator
¶
Bases: ABC
Abstract base for long-range dependence estimators.
All estimators enrolled in a benchmark must implement this interface.
The :meth:fit method receives a :class:SeriesRecord and must return
an :class:EstimateResult containing at minimum a point estimate and
a validity flag.
Source code in src/lrdbench/interfaces.py
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
spec
abstractmethod
property
¶
The estimator's specification (normally an :class:EstimatorSpec).
fit(record)
abstractmethod
¶
Compute an estimate for the given record.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
SeriesRecord
|
The time-series record to analyse. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
An |
EstimateResult
|
class: |
EstimateResult
|
confidence intervals, diagnostics, and runtime. |
Source code in src/lrdbench/interfaces.py
128 129 130 131 132 133 134 135 136 137 138 139 | |
lrdbench.interfaces.BaseGenerator
¶
Bases: ABC
Abstract base for synthetic time-series generators.
Each generator produces a :class:SeriesRecord from a parameter dictionary
and an optional seed. The family property is the registry key used in
manifest source blocks (e.g. fGn, ARFIMA).
Source code in src/lrdbench/interfaces.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
family
abstractmethod
property
¶
Registry key for this generator (e.g. 'fGn', 'ARFIMA').
version
abstractmethod
property
¶
Human-readable version string for provenance tracking.
generate(*, record_id, params, seed, manifest_id)
abstractmethod
¶
Generate a single synthetic record.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record_id
|
str
|
Stable identifier for the record. |
required |
params
|
Mapping[str, Any]
|
Generator-specific parameters (e.g. |
required |
seed
|
int | None
|
Optional RNG seed for reproducibility. |
required |
manifest_id
|
str | None
|
Manifest identifier to embed in provenance. |
required |
Returns:
| Type | Description |
|---|---|
SeriesRecord
|
A fully populated :class: |
Source code in src/lrdbench/interfaces.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
Bundled temporal estimators¶
lrdbench.estimators.temporal.RSEstimator
¶
Bases: BaseEstimator
Rescaled-range Hurst proxy with optional block-bootstrap CIs.
Parameters read from params:
n_bootstrap(int, default 200) – number of bootstrap replicates.bootstrap_block_len(int, defaultmax(4, n//10)) – block length.ci_levels(list, default[0.95]) – nominal coverage levels.min_scale(int, default 8) – minimum R/S subseries length.max_scale(int, optional) – maximum R/S subseries length.scale_ratio(float, default 1.5) – geometric scale spacing.use_anis_lloyd_correction(bool, defaultFalse) – ifTrue, divide each scale's average R/S value by the Anis-Lloyd white-noise expectation before fitting the slope, then add the 0.5 white-noise baseline back to the fitted slope.
Source code in src/lrdbench/estimators/temporal.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | |
lrdbench.estimators.temporal.DFAEstimator
¶
Bases: BaseEstimator
Detrended fluctuation analysis (DFA) scaling exponent as a Hurst proxy.
Source code in src/lrdbench/estimators/temporal.py
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |
lrdbench.estimators.temporal.DMAEstimator
¶
Bases: BaseEstimator
Detrended moving-average fluctuation scaling (Hurst proxy).
Source code in src/lrdbench/estimators/temporal.py
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | |
lrdbench.estimators.temporal.AbsoluteMomentEstimator
¶
Bases: BaseEstimator
Absolute first moment of aggregated series as a Hurst proxy.
Source code in src/lrdbench/estimators/temporal.py
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 | |
lrdbench.estimators.temporal.VarianceEstimator
¶
Bases: BaseEstimator
Variance of aggregated series as a Hurst proxy.
Source code in src/lrdbench/estimators/temporal.py
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 | |
lrdbench.estimators.temporal.VarianceResidualEstimator
¶
Bases: BaseEstimator
Variance of block residuals as a Hurst proxy.
Source code in src/lrdbench/estimators/temporal.py
652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 | |
Bundled spectral estimators¶
lrdbench.estimators.spectral.GPHEstimator
¶
Bases: BaseEstimator
Geweke–Porter–Hudak log-periodogram regression for long-memory parameter d.
Source code in src/lrdbench/estimators/spectral.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
lrdbench.estimators.spectral.PeriodogramRegressionEstimator
¶
Bases: BaseEstimator
Log-periodogram regression (memory parameter d, GPH-type).
Source code in src/lrdbench/estimators/spectral.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | |
lrdbench.estimators.spectral.WhittleMLEEstimator
¶
Bases: BaseEstimator
Gaussian Whittle likelihood for ARFIMA(0,d,0) spectral density.
Source code in src/lrdbench/estimators/spectral.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | |
lrdbench.estimators.spectral.ModifiedLocalWhittleEstimator
¶
Bases: BaseEstimator
Modified (Gaussian) local Whittle estimator of long-memory parameter d.
Source code in src/lrdbench/estimators/spectral.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |
Bundled geometric estimators¶
lrdbench.estimators.geometric.HiguchiEstimator
¶
Bases: BaseEstimator
Higuchi fractal length curve; Hurst proxy H ≈ 2 − D for the time-series graph.
Source code in src/lrdbench/estimators/geometric.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | |
lrdbench.estimators.geometric.GHEEstimator
¶
Bases: BaseEstimator
Geometric Hurst estimator: multiscale variance scaling of lagged increments.
Parameters read from params:
n_scales(int, default 16) – number of geometric lags.h_min(int, default 1) – minimum lag in samples.flat_slope_tol(float, default 0.08) – pragmatic threshold below which the log-log slope is treated as flat and the estimate is clamped to0.5. This is an empiric finite-sample guard, not a theoretically derived bound; set to0.0to disable it.
Source code in src/lrdbench/estimators/geometric.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |
Bundled wavelet estimators¶
lrdbench.estimators.wavelet.WaveletOLSEstimator
¶
Bases: BaseEstimator
Plain OLS on log2 wavelet detail variances vs scale index (log-scale regression).
Source code in src/lrdbench/estimators/wavelet.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | |
lrdbench.estimators.wavelet.WaveletAbryVeitchEstimator
¶
Bases: BaseEstimator
Abry–Veitch-type log-scale regression on wavelet detail variances (Hurst proxy).
Source code in src/lrdbench/estimators/wavelet.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
lrdbench.estimators.wavelet.WaveletBardetEstimator
¶
Bases: BaseEstimator
Weighted log-scale regression (Bardet-type wavelet Hurst proxy).
Source code in src/lrdbench/estimators/wavelet.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
lrdbench.estimators.wavelet.WaveletJensenEstimator
¶
Bases: BaseEstimator
Two-band wavelet slope extrapolation (Jensen-style bias reduction).
Source code in src/lrdbench/estimators/wavelet.py
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | |
lrdbench.estimators.wavelet.WaveletWhittleEstimator
¶
Bases: BaseEstimator
Wavelet-domain Gaussian Whittle-type fit to detail variances across scales.
Source code in src/lrdbench/estimators/wavelet.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | |
Bundled data-driven estimators¶
lrdbench.estimators.data_driven.MLRandomForestEstimator
¶
Bases: _SklearnEstimator
Source code in src/lrdbench/estimators/data_driven.py
265 266 | |
lrdbench.estimators.data_driven.MLSVREstimator
¶
Bases: _SklearnEstimator
Source code in src/lrdbench/estimators/data_driven.py
269 270 | |
lrdbench.estimators.data_driven.MLCNNEstimator
¶
Bases: _TorchSequenceEstimator
Source code in src/lrdbench/estimators/data_driven.py
356 357 | |
lrdbench.estimators.data_driven.MLLSTMEstimator
¶
Bases: _TorchSequenceEstimator
Source code in src/lrdbench/estimators/data_driven.py
360 361 | |
Registries¶
lrdbench.registries.EstimatorRegistry
¶
Bases: Registry[EstimatorBuilder]
Callable(spec: EstimatorSpec) -> BaseEstimator.
Source code in src/lrdbench/registries.py
44 45 46 47 | |
lrdbench.registries.GeneratorRegistry
¶
Bases: Registry[BaseGenerator]
Source code in src/lrdbench/registries.py
33 34 | |
lrdbench.registries.ContaminationRegistry
¶
Bases: Registry[BaseContamination]
Source code in src/lrdbench/registries.py
37 38 | |
Defaults¶
lrdbench.defaults.build_default_estimator_registry()
¶
Source code in src/lrdbench/defaults.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |
lrdbench.defaults.build_default_generator_registry()
¶
Source code in src/lrdbench/defaults.py
47 48 49 50 51 52 53 54 | |
lrdbench.defaults.build_default_contamination_registry()
¶
Source code in src/lrdbench/defaults.py
57 58 59 60 61 62 63 | |
Schema dataclasses¶
lrdbench.schema.BenchmarkManifest
dataclass
¶
Source code in src/lrdbench/schema.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | |
lrdbench.schema.SeriesRecord
dataclass
¶
Source code in src/lrdbench/schema.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
lrdbench.schema.EstimateResult
dataclass
¶
Source code in src/lrdbench/schema.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
lrdbench.schema.EstimatorSpec
dataclass
¶
Source code in src/lrdbench/schema.py
76 77 78 79 80 81 82 83 84 85 86 87 | |
lrdbench.schema.MetricSpec
dataclass
¶
Definition of a benchmark metric.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Machine-readable metric identifier (e.g. |
symbol |
str
|
Short symbol for tables (e.g. |
requires_truth |
bool
|
Whether the metric needs a ground-truth target value. |
admissible_modes |
tuple[BenchmarkMode, ...]
|
Benchmark modes where this metric is valid. |
aggregation_rule |
str
|
How stratum-level values are combined (e.g.
|
optimisation_direction |
OptimisationDirection
|
Whether lower or higher values are better. |
unit |
str | None
|
Optional unit string for reporting. |
null_policy |
str
|
How missing values are handled. |
nominal_levels |
tuple[float, ...]
|
Coverage levels (e.g. |
parameters |
Mapping[str, Any]
|
Extra metric-specific parameters. |
Source code in src/lrdbench/schema.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
lrdbench.schema.MetricValue
dataclass
¶
Source code in src/lrdbench/schema.py
139 140 141 142 143 144 145 146 147 | |
lrdbench.schema.MetricBundle
dataclass
¶
Source code in src/lrdbench/schema.py
150 151 152 153 154 155 | |
lrdbench.schema.LeaderboardSpec
dataclass
¶
Source code in src/lrdbench/schema.py
158 159 160 161 162 163 164 165 | |
lrdbench.schema.LeaderboardRow
dataclass
¶
Source code in src/lrdbench/schema.py
168 169 170 171 172 173 174 175 | |
lrdbench.schema.ReportSpec
dataclass
¶
Source code in src/lrdbench/schema.py
178 179 180 181 182 183 184 185 186 187 188 189 | |
lrdbench.schema.ReportBundle
dataclass
¶
Source code in src/lrdbench/schema.py
204 205 206 207 208 209 210 211 212 213 214 215 | |
lrdbench.schema.BenchmarkRunOutput
dataclass
¶
Source code in src/lrdbench/schema.py
238 239 240 241 242 243 244 245 246 247 | |
lrdbench.schema.PluginProvenanceRecord
dataclass
¶
Source code in src/lrdbench/schema.py
45 46 47 48 49 50 51 52 53 | |
Validation and contracts¶
lrdbench.validation.validate_manifest(manifest, *, strict_unknown_keys=True)
¶
Source code in src/lrdbench/validation.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | |
lrdbench.validation.validate_metric_admissibility(metric_spec, mode, record=None)
¶
Source code in src/lrdbench/validation.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
lrdbench.validation.validate_truth_compatibility(estimator_spec, record)
¶
Source code in src/lrdbench/validation.py
207 208 209 210 211 212 213 214 | |
lrdbench.output_contract.public_output_contract()
¶
Source code in src/lrdbench/output_contract.py
183 184 | |
lrdbench.output_contract.required_output_files()
¶
Source code in src/lrdbench/output_contract.py
187 188 189 | |
lrdbench.output_contract.validate_output_contract(run_root)
¶
Source code in src/lrdbench/output_contract.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
Bootstrap utilities¶
lrdbench.bootstrap.circular_block_resample(x, rng, block_len)
¶
Circular block bootstrap resample of the same length as x.
The series is treated as circular (wrap-around at the boundaries) to avoid edge artefacts. Blocks are concatenated until the desired length is reached, then truncated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
ndarray
|
1-D input array. |
required |
rng
|
Generator
|
NumPy random generator instance. |
required |
block_len
|
int
|
Block length in samples. Clamped to |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
A resampled array of the same shape as |
Source code in src/lrdbench/bootstrap.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
lrdbench.bootstrap.bootstrap_statistic_distribution(x, rng, statistic, *, n_boot, block_len)
¶
Compute a bootstrap distribution for statistic using circular block resampling.
Only finite replicate values are retained; None or non-finite results
are silently dropped. This is important for estimators that may fail on
short resampled blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
ndarray
|
1-D input array (the original time series). |
required |
rng
|
Generator
|
NumPy random generator instance. |
required |
statistic
|
Callable[[ndarray], float | None]
|
Function that takes a 1-D array and returns a scalar or |
required |
n_boot
|
int
|
Number of bootstrap replicates. |
required |
block_len
|
int
|
Block length in samples. A common pragmatic default is
|
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
1-D array of finite bootstrap replicates. |
Source code in src/lrdbench/bootstrap.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
lrdbench.bootstrap.symmetric_percentile_cis(samples, alphas)
¶
Symmetric percentile confidence intervals from bootstrap samples.
For each nominal level alpha the interval is
[q_{(1-alpha)/2}, q_{1-(1-alpha)/2}] where q denotes the sample
quantile of the bootstrap distribution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
samples
|
ndarray
|
1-D array of bootstrap replicates (e.g. from
:func: |
required |
alphas
|
tuple[float, ...]
|
Nominal coverage levels (e.g. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float, float]
|
Tuple of |
...
|
Empty if |
Source code in src/lrdbench/bootstrap.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
Plugin discovery¶
lrdbench.plugin_loader.PluginDiscoveryResult
¶
Immutable record produced by a single plugin load attempt.
Source code in src/lrdbench/plugin_loader.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
lrdbench.plugin_loader.discover_plugins_from_env()
¶
Read LRD_BENCH_ESTIMATOR_PLUGIN and LRD_BENCH_ESTIMATOR_PLUGIN_PATH
and return all discovered (success or failure) results.
Source code in src/lrdbench/plugin_loader.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |
lrdbench.plugin_loader.build_estimator_registry_with_plugins(*, base_registry=None, plugin_results=None)
¶
Build an estimator registry, optionally including third-party plugins.
Returns the combined registry alongside the final plugin discovery results. Built-in estimators take precedence when names collide.
Source code in src/lrdbench/plugin_loader.py
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
Packaged assets and testing helpers¶
lrdbench.public_assets.list_public_suites()
¶
Source code in src/lrdbench/public_assets.py
23 24 25 26 27 28 29 30 31 32 33 34 35 | |
lrdbench.public_assets.resolve_manifest_argument(value)
¶
Source code in src/lrdbench/public_assets.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
lrdbench.testing.estimator_spec(*, name='CandidateEstimator', family='external', target_estimand='hurst_scaling_proxy', assumptions=(), supports_ci=False, supports_diagnostics=True, params=None, version=None)
¶
Source code in src/lrdbench/testing.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
lrdbench.testing.synthetic_series_record(values, *, record_id='test_record', source_name='test')
¶
Source code in src/lrdbench/testing.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
lrdbench.testing.smoke_fit_estimator(estimator, values, *, min_value=None, max_value=None)
¶
Source code in src/lrdbench/testing.py
73 74 75 76 77 78 79 80 81 82 | |
lrdbench.testing.assert_valid_estimate(result, *, min_value=None, max_value=None)
¶
Source code in src/lrdbench/testing.py
50 51 52 53 54 55 56 57 58 59 60 61 62 | |
lrdbench.testing.assert_invalid_estimate(result, *, reason_contains=None)
¶
Source code in src/lrdbench/testing.py
65 66 67 68 69 70 | |