A common technique in time series analysis is the "moving window" (either the time series flows through the window or the window moves along the time series).
Statistics are calculated "within the window", for example when analyzing a stock ticker you might want to look at a 30 day or 90 day moving average.
Usually people use fixed size windows, and in that case, the larger the window the smoother the result. For example the average (mean) will change less with a 90 day window, compared to a 7 day window. The shorter window will tend to pick up the "jaggies" in the daily trading.
So this situation is very much like Benoit Mandelbrot's famous paper on fractals, entitled "How Long Is The Coastline Of Britain?". The answer is, it depends on the size of your yardstick. A short ruler will pick up the jaggies, whereas a long measuring stick will give you distance as the crow flies.
In fractal geometry there is a way of calculating the difference in the measurement depending on the size of the yardstick - but only for certain types of functions, those that are "self similar". In information theory this concept is extended into the "relative entropy" using the KL divergence or Renyi's theory of entropy.
In the stock market, the purpose is to predict the next stock value. "Trends" can be seasonal, or industry related, or tied to interest rates or closing days. Stock tickers can also be self similar, meaning they have fractal content tied to volatility. In the latter case, changing the window size can reveal some of the fractal content.
Wall Street has been using neural networks for time series analysis and prediction for years. The networks are "trained" with historical time series, on the assumption that historical behavior is likely to continue. Typically such analysis is an overnight affair, historical data is "passed through" various size windows and the most recent trends are used to strategize the next day's trading. Typically such analysis is multi dimensional - they don't analyze just one ticker, they analyze all stocks within an industry, or a basket or an index. When the stocks are related, it looks very much like a retina, where each pixel is its own time series. And, much like the human visual system, the analytics extract periodicity in both time and space, along with the covariances and relative entropies.
So here is my question: how are the various window sizes related to each other? If you pick up a periodicity in a 7 day window that doesn't appear in a 30 day window, what does it mean?
Mandelbrot would tell you it means you have pebbles of a certain size, along your coastline. They only become visible within a narrow range of yardsticks. If the yardstick is too big, they won't be visible at all. If the yardstick is too small, they'll get lost in the molecules of sand. If the yardstick is somewhere between the size of a pebble and the distance between pebbles, you'll start seeing them.
But this requires one of two things: either foreknowledge of the size of the pebbles (so you can choose the proper sized yardstick), or a "sweeping window width" which then requires further analysis to identify which widths show the pebbles.
A sweeping window width is computationally expensive, because you have to pass the data through multiple times, once for each width. But what if you could do all the widths at once, in parallel? Then you could just look for the peaks and there's your periodicity. The issue becomes one of visualization. How do you visualize stochastic periodicity, for instance where the pebbles are all the same size but the distance between pebbles varies widely? Or vice versa?
The math gets pretty hairy. For example:
Can anyone suggest a better way?
Here's a hint. This one's called a "mesochronic plot".
Here's another version of it:
Note the things that look like planes. What do they mean? Note the axes f1 and f2, those are frequencies, in the case of pebbles they would be spatial frequencies. The equidistant planes are showing us an orientation. What does it mean?
This is very cool stuff. Our brains do this in real time. Whereas it takes a Python program overnight to calculate the orientation of the planes. A further hint: the planes are covectors. The blue picture was generated by a Google AI program called TensorFlow (which is the same program they used to train ChatGPT).
We are trying to visualize the pebbles along the coastline of Britain, with no knowledge whatsoever about their size and shape, or even their existence.
Statistics are calculated "within the window", for example when analyzing a stock ticker you might want to look at a 30 day or 90 day moving average.
Usually people use fixed size windows, and in that case, the larger the window the smoother the result. For example the average (mean) will change less with a 90 day window, compared to a 7 day window. The shorter window will tend to pick up the "jaggies" in the daily trading.
So this situation is very much like Benoit Mandelbrot's famous paper on fractals, entitled "How Long Is The Coastline Of Britain?". The answer is, it depends on the size of your yardstick. A short ruler will pick up the jaggies, whereas a long measuring stick will give you distance as the crow flies.
In fractal geometry there is a way of calculating the difference in the measurement depending on the size of the yardstick - but only for certain types of functions, those that are "self similar". In information theory this concept is extended into the "relative entropy" using the KL divergence or Renyi's theory of entropy.
In the stock market, the purpose is to predict the next stock value. "Trends" can be seasonal, or industry related, or tied to interest rates or closing days. Stock tickers can also be self similar, meaning they have fractal content tied to volatility. In the latter case, changing the window size can reveal some of the fractal content.
Wall Street has been using neural networks for time series analysis and prediction for years. The networks are "trained" with historical time series, on the assumption that historical behavior is likely to continue. Typically such analysis is an overnight affair, historical data is "passed through" various size windows and the most recent trends are used to strategize the next day's trading. Typically such analysis is multi dimensional - they don't analyze just one ticker, they analyze all stocks within an industry, or a basket or an index. When the stocks are related, it looks very much like a retina, where each pixel is its own time series. And, much like the human visual system, the analytics extract periodicity in both time and space, along with the covariances and relative entropies.
So here is my question: how are the various window sizes related to each other? If you pick up a periodicity in a 7 day window that doesn't appear in a 30 day window, what does it mean?
Mandelbrot would tell you it means you have pebbles of a certain size, along your coastline. They only become visible within a narrow range of yardsticks. If the yardstick is too big, they won't be visible at all. If the yardstick is too small, they'll get lost in the molecules of sand. If the yardstick is somewhere between the size of a pebble and the distance between pebbles, you'll start seeing them.
But this requires one of two things: either foreknowledge of the size of the pebbles (so you can choose the proper sized yardstick), or a "sweeping window width" which then requires further analysis to identify which widths show the pebbles.
A sweeping window width is computationally expensive, because you have to pass the data through multiple times, once for each width. But what if you could do all the widths at once, in parallel? Then you could just look for the peaks and there's your periodicity. The issue becomes one of visualization. How do you visualize stochastic periodicity, for instance where the pebbles are all the same size but the distance between pebbles varies widely? Or vice versa?
The math gets pretty hairy. For example:
Can anyone suggest a better way?
Here's a hint. This one's called a "mesochronic plot".
Here's another version of it:
Note the things that look like planes. What do they mean? Note the axes f1 and f2, those are frequencies, in the case of pebbles they would be spatial frequencies. The equidistant planes are showing us an orientation. What does it mean?
This is very cool stuff. Our brains do this in real time. Whereas it takes a Python program overnight to calculate the orientation of the planes. A further hint: the planes are covectors. The blue picture was generated by a Google AI program called TensorFlow (which is the same program they used to train ChatGPT).
We are trying to visualize the pebbles along the coastline of Britain, with no knowledge whatsoever about their size and shape, or even their existence.