1
$\begingroup$

According to this answer: https://datascience.stackexchange.com/a/95232/141037, is possible to verify the forecastability of a time series using the Shannon entropy, the lower the Shannon entropy value, the more forecastable it is. My question is: the time series I use for forecasting tests (regression problem) is windowed (shape (videos, frames, frame height, frame width), I applied a sliding window to it). Can I use this windowed time series to calculate shannon entropy?

$\endgroup$
7
  • $\begingroup$ Sure you can. What are you going to do with that entropy? Entropy here is a statistic that is derived from your data. What you need to understand is what values of this statistic are important for you, and whether this statistic is sensitive enough to things you care about. My advice would be to generate some synthetic data which is either completely noise, or time-correlated. Process that data as you wish (windowing etc), calculate entropy, and then decide whether the obtained signal is useful $\endgroup$
    – Cryo
    Commented Mar 27 at 15:09
  • 1
    $\begingroup$ For example, you calculate entropy and you get 42.0.... now what? $\endgroup$
    – Cryo
    Commented Mar 27 at 15:10
  • $\begingroup$ @Cryo I'm thinking about analyzing different sections of my windowed time series to see which are the most forecastable, so that I can then test these most forecastable parts via machine learning. Thanks. $\endgroup$
    – Marco
    Commented Mar 27 at 21:06
  • $\begingroup$ Makes sense. It feels to me like you will still need to know what meaningful difference in entropy is. So it might be a good idea to simulate what you are planning to do, to understand what entropies to expect $\endgroup$
    – Cryo
    Commented Mar 27 at 21:44
  • 1
    $\begingroup$ It is the case in many applied predictive situations that 'ground truth' for the model either isn't available or, more simply, does not exist. In such cases model validation is obtained from the usefulness of the results: does it predict? are greater (lesser) values of a metric helpful or insightful? And so on. Wrt time series information theoretic metrics such as permutation entropy may be more useful than Shannon entropy. See Brandmaier's papers on PE jstatsoft.org/article/view/v067i05 $\endgroup$
    – user78229
    Commented Mar 28 at 8:01

1 Answer 1

0
$\begingroup$

You can apply any technique you want to your data, the trouble will always be with interpreting the results. Say you compute entropy, how do you know which entropy is significant? How do you know one signal's entropy is substantially larger/smaller than another?

Besides analytical derivations, here one can take an empirical approach. What type of time-series are you expecting to forecast? Say something similar to ARMA with one independent variable:

$$ \begin{align} y_t-\phi \cdot y_{t-1}&=\epsilon_t-\theta \cdot \epsilon_{t-1} + \eta\cdot x_t \\ \left(\begin{array} \\ 1 & -\phi & 0 & 0 & \dots & 0 & 0 & 0\\ 0 & 1 & -\phi & 0 & 0 & \dots & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & \dots & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & \dots & 0 & 0\\ \vdots & \ddots & \ddots & \ddots & \ddots & 1 &-\phi & 0\\ 0 & 0 & 0 & \ddots & \ddots & \dots & 1 & -\phi\\ 0 & 0 & 0 & 0 & 0 & \dots & 0 &1 \\ \end{array} \right) \left(\begin{array} \\ y_t \\ y_{t-1} \\ \vdots \\ \vdots \\ \vdots \\ \vdots \\ y_2 \\ y_1 \end{array} \right)&= \left(\begin{array} \\ \epsilon_t-\theta\cdot \epsilon_{t-1}+\eta\cdot x_t \\ \epsilon_{t-1}-\theta\cdot \epsilon_{t-2}+\eta\cdot x_{t-1} \\ \vdots \\ \vdots \\ \vdots \\ \vdots \\ \epsilon_2-\theta\cdot y_1+\eta\cdot x_2 \\ \epsilon_1+\eta\cdot x_1 \end{array} \right) \end{align} $$

Where $\epsilon_{\dots}$ is your noise, $x_{\dots}$ is the independent variable, $y_{\dots}$ is dependent (and is zero for $t\le 0$). One can re-arrange the above to:

$$ \left(\begin{array} \\ y_t \\ y_{t-1} \\ \vdots \\ \vdots \\ \vdots \\ \vdots \\ y_2 \\ y_1 \end{array} \right)= \left(\begin{array} \\ 1 & \phi & \phi^2 & \phi^3 & \dots & \phi^{n-1} & \phi^{n-2} & \phi^{n-1}\\ 0 & 1 & \phi & \phi^2 & \phi^3 & \dots & \phi^{n-1} & \phi^{n-2} \\ \vdots & \ddots & \ddots & \ddots & \ddots & \dots & \dots & \dots\\ \vdots & \ddots & \ddots & \ddots & \ddots & \dots & \dots & \dots\\ \vdots & \ddots & \ddots & \ddots & \ddots & 1 &\phi & \phi^2\\ 0 & 0 & 0 & \ddots & \ddots & \dots & 1 & \phi\\ 0 & 0 & 0 & 0 & 0 & \dots & 0 &1 \\ \end{array} \right) \left(\begin{array} \\ \epsilon_t-\theta\cdot \epsilon_{t-1}+\eta\cdot x_t \\ \epsilon_{t-1}-\theta\cdot \epsilon_{t-2}+\eta\cdot x_{t-1} \\ \vdots \\ \vdots \\ \vdots \\ \vdots \\ \epsilon_2-\theta\cdot y_1+\eta\cdot x_2 \\ \epsilon_1+\eta\cdot x_1 \end{array} \right) $$

Where we assume $n$ time-steps. So all you need to do now is generate random $\epsilon$, choose $\theta,\phi$ and $x_t$. Then plug everything into the vector on the right, multiply it by the matrix (formally the inverse of a Lag Operator matrix). And you will get time-series that is correlated as per your spec. You can then apply all the procedures you want on it, and test to see whether those procedures will allow you to distinguish between predictable (mostly controlled by large $\eta$ and $\phi$) and un-predictable time-series. You can even get an empirical distribution of your entropy (by repeating this process many times.)

This is just one example of course. There are other ways you can generate time series. This one is nice because it is analytically tractable

$\endgroup$
4
  • $\begingroup$ Quick link on the inverse of a Lag operator, in case it helps ealdrich.github.io/Teaching/Econ211C/LectureNotes/Unit1-ARMA/… $\endgroup$
    – Cryo
    Commented Mar 28 at 7:51
  • $\begingroup$ I'm sorry for the delay in answering to you. I appreciate your help but I'm having trouble to understand this. I recently started using spectral entropy to analyze time series, following the information I provided. I'm having difficulty for interpreting the results, the entropy of the last 25% of a series is 0.19, and the entropy of the entire series is 0.23, does this make sense? Isn't the more data a neural network has better to forecast, for example? $\endgroup$
    – Marco
    Commented Apr 28 at 23:01
  • 1
    $\begingroup$ @Marco, I don't know whether it makes sense. I don't know the exact implementation of your algorithm, and even if I did I don't use entropy that often, and even if I did, I don't know the entropy in your time-series (before the spectral bit etc). This is precisely what I meant by my comment in the OP. You have got the number 'Now what?'. As I explained above, I think you need to simulate/synthesize some time-series with properties that you control and put them into your entropy computing algorithm. This will give you a reference point, i.e. what normal entropy for you looks like. $\endgroup$
    – Cryo
    Commented Apr 28 at 23:45
  • $\begingroup$ ok, thank you very much, I will try to do it. $\endgroup$
    – Marco
    Commented Apr 29 at 0:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.