Original Source Here

# Random Walks

A more challenging but equally unpredictable distribution in time series forecasting is a random walk. Unlike white noise, it has non-zero mean, non-constant std/variance, and when plotted, looks a lot like a regular distribution:

Random walk series are always cleverly disguised in this manner, but still, they are unpredictable as ever. The best guess for today’s value is yesterday’s.

A common confusion among beginners is thinking of a random walk as a simple sequence of random numbers. This is not the case because, in a random walk, each step is dependent on the previous step.

For this reason, the Autocorrelation function of random walks *does *return non-zero correlations.

The formula of a random walk is simple:

Whatever the previous data point is, add some random value to it and continue for as long as you like. Let’s generate this in Python with a starting value of, let’s say, 99:

Let’s also plot the ACF:

As you can see, the first ~40 lags yield statistically significant correlations.

So, how do we detect a random walk when a visualization is not an option?

Because of how they are created, differencing the time series should isolate the random addition of each step. Taking the first-order difference is done by lagging the series by 1 and subtracting it from the original. Pandas has a convenient `diff`

function to do this:

If you plot the first-order difference of a time series and the result is white noise, then it is a random walk.

AI/ML

Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot