bootstrap()

tsbootstrap.bootstrap(X: object, *, method: BaseMethodSpec, n_bootstraps: int = 999, random_state: int | Generator | SeedSequence | None = None, exog: object | None = None) BootstrapResult[source]

Generate bootstrap replicates of a time series.

Parameters:
  • X (array-like) – Observations, shape (n,) or (n, d).

  • method (BaseMethodSpec) – A method spec (e.g. MovingBlock(block_length="auto")).

  • n_bootstraps (int, default 999) – Number of replicates.

  • random_state (int | numpy Generator | SeedSequence | None) – Reproducibility seed. Replicate i is bound to its own generator, so results are reproducible for a given seed and environment (OS, hardware, BLAS, NumPy), as with NumPy/scikit-learn.

  • exog (array-like or None) – Optional exogenous regressors, shape (n,) or (n, k), aligned with X, held fixed during regeneration. Supported for ResidualBootstrap with an AR (ARX), VAR (VARX), or ARIMA (ARIMAX) model, and for SieveAR. ARX/VARX require initial="fixed" and burn_in=0 (the exog must align with each step); ARIMAX has no such constraint (exog enters at the level after inverse-differencing).

Returns:

Sequence of BootstrapSample plus metadata.

Return type:

BootstrapResult