Welcome to tsbootstrap’s documentation!

tsbootstrap generates bootstrap replicates of time series data. The entire public API is one typed function, bootstrap(), configured with a method specification object.

import numpy as np
from tsbootstrap import bootstrap, MovingBlock

x = np.random.default_rng(0).standard_normal(200)
result = bootstrap(x, method=MovingBlock(block_length="auto"), n_bootstraps=999, random_state=0)

samples = result.values()      # shape (999, 200)
oob     = result.get_oob_mask()  # shape (999, 200) boolean out-of-bag mask

Tutorials

Indices and tables