Parameters m
and r
, involved in calculation of approximate entropy (ApEn) of time series, are window (sequence) length and tolerance (filter value), correspondingly. In fact, in terms of m
, r
as well as N
(number of data points), ApEn is defined as "natural logarithm of the relative prevalence of repetitive patterns of length m
as compared with those of length m + 1
" (Balasis, Daglis, Anastasiadis & Eftaxias, 2011, p. 215):
$$ ApEn(m, r, N) = \Phi^m(r) - \Phi^{m+1}(r), $$
$\text{where }$
$$ \Phi^m(r) = {\LARGE{\Sigma}_i} lnC^m_i(r)/(N - m + 1) $$
Therefore, it appears that changing the tolerance r
allows to control the (temporal) granularity of determining time series' entropy. Nevertheless, using the default values for both m
and r
parameters in pracma
package's entropy function calls works fine. The only fix that needs to be done to see the correct entropy values relation for all three time series (lower entropy for more well-defined series, higher entropy for more random data) is to increase the length of random data vector:
library(pracma)
series1 <- approx_entropy(AirPassengers)
series1
[1] 0.5157758
series2 <- approx_entropy(sunspot.year)
series2
[1] 0.762243
series3 <- approx_entropy(rnorm(1:500)) # <== size increased
series3
[1] 1.471472
The results are as expected - as the predictability of fluctuations decreases from most determined series1
to most random series 3
, their entropy consequently increases: ApEn(series1) < ApEn(series2) < ApEn(series3)
.
In regard to other measures of forecastability, you may want to check mean absolute scaled errors (MASE) - see this discussion for more details. Forecastable component analysis also seems to be an interesting and new approach to determining forecastability of time series. And, expectedly, there is an R
package for that, as well - ForCA
: http://cran.r-project.org/web/packages/ForeCA.
References
Balasis, G., Daglis, I. A., Anastasiadis, A., & Eftaxias, K. (2011). Detection of dynamical complexity changes in Dst time sSeries using entropy concepts and rescaled range analysis. In W. Liu and M. Fujimoto (Eds.), The Dynamic Magnetosphere, IAGA Special Sopron Book, Series 3, 211. doi:10.1007/978-94-007-0501-2_12. Springer. Retrieved from http://members.noa.gr/anastasi/papers/B29.pdf