qis.generate_bootstrapped_indices¶
- qis.generate_bootstrapped_indices(num_data_index, bootstrap_type=BootstrapType.IID, num_samples=10, index_length=1000, block_size=30, min_block_size=1, seed=1)[source]¶
draw resampling indices, without touching any data.
This is the primitive behind every
bootstrap_*function, and it is public because the indices are what makes paired resampling possible: draw once, then apply the same index array to several aligned panels so their joint structure survives the resample. Pass the result asbootstrapped_indicestobootstrap_data()and friends.- Parameters:
num_data_index (int) – number of observations in the source data
bootstrap_type (BootstrapType) – resampling scheme; see
BootstrapTypenum_samples (int) – number of independent bootstrap draws, the columns of the result
index_length (int) – length of each draw, the rows of the result. May differ from
num_data_indexblock_size (int) – mean block length for STATIONARY, exact block length for FIXED_BLOCK, ignored for IID
min_block_size (int) – floor on the drawn block length under STATIONARY. Set it to the number of periods in the slowest-reporting series when the panel mixes frequencies
seed (int) – seed for the numba random state
- Returns:
integer indices, shape
(index_length, num_samples), with every requested position populated from[0, num_data_index); dependence between positions followsbootstrap_type- Raises:
ValueError – if
bootstrap_typeis not one of the implemented schemes- Return type: