I'm performing a Bootstrap Random Walk over a set of points which is a time series with a certain pattern.
Right now, I took the set of points and then resample it with replacement.
# Resample data with replacement bootstrap_data = np.random.choice(variable, size=len(variable))
Then I create a random walk with the same properties as the boostrap_data.
walk = np.cumsum(np.random.normal(loc=0, scale=bootstrap_data.std(), size=n_steps)) walk += bootstrap_data.mean()
Finally, I get the Bootstrap random walk and I used their mean to get a new time series with the same properties to adjust the original time series.
walk = variable.values - (np.mean(variable.values) - np.mean(walk))
My idea is to be able to preserve the same structure and pattern of the real set of points but add random and not biased variability to this one through bootstrapping and random walking.
As I see it, is a simple version of block bootstrapping or structural bootstrapping. The final output is a set of scenarios with random variability which preserve the main structure and patterns of the original.
The question is the following.
Do you think this implementation is following the principles? or is something to mention?