StationaryBootstrap#

Functions

StationaryBootstrap(data, m, sampleLength)

Returns a bootstraped sample of the time-series "data" of length "sampleLength.

StationaryBootstrap(data: ndarray, m, sampleLength) ndarray[source]#

Returns a bootstraped sample of the time-series “data” of length “sampleLength.

The algorithm used is stationary bootstrap from 1994 Politis & Romano.

Parameters:
  • data – ndarray array. A single vector of numbers containing the time-series.

  • m – floating number. Parameter to stationary bootstrap indicating the average length of each block in the sample.

  • sampleLength – integer. Length of the bootstrapped sample returned as output.

Returns:

ndarray array containing the final bootstraped sample.

Return type:

sample

Example

>>> import numpy as np
>>> data = np.array([1,2,3,4,5,6,7,8,9,10])
>>> m = 4
>>> sampleLength = 12
>>> StationaryBootstrap(data, m, sampleLength)
array([[9.],
        [3.],
        [4.],
        [5.],
        [6.],
        [7.],
        [8.],
        [7.],
        [2.],
        [3.],
        [4.],
        [2.]])

Original paper about stationary bootstrap: Dimitris N. Politis & Joseph P. Romano (1994) The Stationary Bootstrap, Journal of the American Statistical Association, 89:428, 1303-1313, DOI: 10.1080/01621459.1994.10476870

Implemented by Gregor Fabjan from Qnity Consultants on 12/11/2021.