Nonlinear Dynamics

, Volume 94, Issue 3, pp 1987–2001 | Cite as

q-SampEnAve: an adaptive measurement to recognize the patterns for short-term financial time series

  • Jiayi HeEmail author
  • Pengjian Shang
Original Paper


Adaptive algorithms are increasingly discussed because of few parameter constraints, which can respond to different inputs and make the results more accurate. In this paper, we propose a self-tuning complexity measurement for short time series, called q-sample entropy average (q-SampEnAve), which is a data-driven approach. This approach avoids the impact of tolerance r in traditional sample entropy (SampEn) by considering all r candidates. Besides, q-sample entropy (q-SampEn), as an intermediate stage, could serve as a good discriminative tool as well. By discussing parameter q, we find that the q plays a decisive role in the results that large positive q filters out the large \(p_i\) in a probability distribution, and large negative q filter out the rare events. These two factors make our new method more accurate and complete than existing methods. In simulated experiments, ARFIMA model, uniform distribution and logistic map are employed. It reveals that sequences generated two-component ARFIMA models are distinctly separated from uniform distribution in (0, 1) and logistic mapping (\(a = 4\)). Besides, even for the sequences generated by ARFIMA model with different parameters, four states (mean, std, kurtosis and skewness) show a little different. Most importantly, uniform distribution in (0, 1) and logistic mapping (\(a =4\)) are relatively disordered. On the contrary, the system generated by the ARFIMA model are relatively regular. For stock indices, the performance of SSE Composite Index (000001.SS) and SZSE Composite Index (399001.SZ) are identical, while Hang Seng Index (\(\hat{}\)HSI) behaves closer to Dow Jones Industrial Average ( \(\hat{}\)DJI) and Nasdaq Composite ( \(\hat{}\)IXIC) than indices in mainland China (000001.SS and 399001.SZ), which may be related to the economic policy and the market environment. It also illustrates that the US stock market is relatively mature and more suitable for investment. Finally, we give a brief discussion about the application in random bit sequence, which illustrates that random bit sequences generated from different parameters can be recognized.


q-SampEnAve Sample entropy Complexity measurement Financial time series 



The financial supports from the funds of the Fundamental Research Funds for the Central Universities (2018JBZ104), the China National Science (61771035) and the Beijing National Science (4162047) are gratefully acknowledged. In addition, we sincerely appreciate the editor and all reviewers for their useful suggestions.

Compliance with ethical standards

Conflict of interest

The authors declare that there is no conflict of interest regarding the publication of this paper.


  1. 1.
    Zhao, X., Shang, P.: Measuring the uncertainty of coupling. EPL 110(6), 60007 (2015)CrossRefGoogle Scholar
  2. 2.
    Wang, J., Shang, P., Zhao, X., Xia, J.: Multiscale entropy analysis of traffic time series. Int. J. Mod. Phys. C 24(02), 1883–1896 (2013)MathSciNetCrossRefGoogle Scholar
  3. 3.
    Wang, X., Shang, P., Fang, J.: Traffic time series analysis by using multiscale time irreversibility and entropy. Chaos Interdiscip. J. Nonlinear Sci. 24(3), 032102 (2014)CrossRefGoogle Scholar
  4. 4.
    Huang, J., Shang, P., Zhao, X.: Multifractal diffusion entropy analysis on stock volatility in financial markets. Phys. A Stat. Mech. Its Appl. 391(22), 5739–5745 (2012)CrossRefGoogle Scholar
  5. 5.
    Teng, Y., Shang, P.: Transfer entropy coefficient: quantifying level of information flow between financial time series. Phys. A Stat. Mech. Its Appl. 469, 60–70 (2017)CrossRefGoogle Scholar
  6. 6.
    Yin, Y., Shang, P.: Weighted multiscale permutation entropy of financial time series. Nonlinear Dyn. 78(4), 2921–2939 (2014)MathSciNetCrossRefGoogle Scholar
  7. 7.
    Richman, J., Moorman, J.: Physiological time-series analysis using approximate entropy and sample entropy. Am. J. Physiol. Heart Circ. Physiol. 278(6), H2039–H2049 (2000)CrossRefGoogle Scholar
  8. 8.
    Pincus, S.: Approximate entropy (apen) as a complexity measure. Chaos 5(1), 110–117 (1995)MathSciNetCrossRefGoogle Scholar
  9. 9.
    Pincus, S.: Quantifying complexity and regularity of neurobiological systems. Methods Neurosci. 28, 336–363 (1995)CrossRefGoogle Scholar
  10. 10.
    Schuckers, S.: Use of approximate entropy measurements to classify ventricular tachycardia and fibrillation. J. Electrocardiol. 31(1), 101–105 (1998)CrossRefGoogle Scholar
  11. 11.
    Pincus, S., Viscarello, R.: Approximate entropy: a regularity measure for fetal heart rate analysis. Obstet. Gynecol. 79(2), 249–255 (1992)Google Scholar
  12. 12.
    Yin, Y., Shang, P., Feng, G.: Modified multiscale cross-sample entropy for complex time series. Appl. Math. Comput. 289, 98–110 (2016)MathSciNetGoogle Scholar
  13. 13.
    Yin, Y., Shang, P.: Modified cross sample entropy and surrogate data analysis method for financial time series. Phys. A Stat. Mech. Its Appl. 433, 17–25 (2015)MathSciNetCrossRefGoogle Scholar
  14. 14.
    Shi, W., Shang, P.: Cross-sample entropy statistic as a measure of synchronism and cross-correlation of stock markets. Nonlinear Dyn. 71(3), 539–554 (2013)MathSciNetCrossRefGoogle Scholar
  15. 15.
    Costa, M., Goldberger, A., Peng, C.: Multiscale entropy of biological signals. Phys. Rev. E 71(2–1), 021906 (2005)MathSciNetCrossRefGoogle Scholar
  16. 16.
    Silva, L.E.V., Jr, L.O.M.: Evaluation of physiologic complexity in time series using generalized sample entropy and surrogate data analysis. Chaos Interdiscip. J. Nonlinear Sci. 22(4), 479–487 (2012)MathSciNetGoogle Scholar
  17. 17.
    Silva, L.E.V., Cabella, B.C.T., Neves, U.P.D.C., Junior, L.O.M.: Multiscale entropy-based methods for heart rate variability complexity analysis. Phys. A Stat. Mech. Its Appl. 422(422), 143–152 (2015)CrossRefGoogle Scholar
  18. 18.
    Xu, M., Shang, P., Huang, J.: Modified generalized sample entropy and surrogate data analysis for stock markets. Commun. Nonlinear Sci. Numer. Simul. 35, 17–24 (2016)MathSciNetCrossRefGoogle Scholar
  19. 19.
    Pincus, S.: Approximate entropy as a measure of system complexity. Proc. Nat. Acad. Sci. USA 88(6), 2297–2301 (1991)MathSciNetCrossRefGoogle Scholar
  20. 20.
    Mayer, C., Bachler, M., Hortenhuber, M., Stocker, C., Holzinger, A., Wassertheurer, S.: Selection of entropy-measure parameters for knowledge discovery in heart rate variability data. BMC Bioinform. 15(S6), 1–11 (2014)Google Scholar
  21. 21.
    Lu, S., Chen, X., Kanters, J., Solomon, I., Chon, K.: Automatic selection of the threshold value for approximate entropy. IEEE Trans. Bio-med. Eng. 55(8), 1966–1972 (2008)CrossRefGoogle Scholar
  22. 22.
    Maestri, R., Pinna, G.D., Porta, A., Balocchi, R., Sassi, R., Signorini, M.G., Dudziak, M., Raczak, G.: Assessing nonlinear properties of heart rate variability from short-term recordings: are these measurements reliable? Physiol. Meas. 28(28), 1067–1077 (2007)CrossRefGoogle Scholar
  23. 23.
    Udhayakumar, R.K., Karmakar, C., Palaniswami, M.: Approximate entropy profile: a novel approach to comprehend irregularity of short-term HRV signal. Nonlinear Dyn. 88(2), 1–15 (2017)CrossRefGoogle Scholar
  24. 24.
    Lake, D., Richman, J., Griffin, M., Moorman, J.: Sample entropy analysis of neonatal heart rate variability. Am. J. Physiol. Regul. Integr. Comp. Physiol. 283(3), R789 (2002)CrossRefGoogle Scholar
  25. 25.
    Eduardo, V., Otavio, M.: Evaluation of physiologic complexity in time series using generalized sample entropy and surrogate data analysis. Chaos Interdiscip. J. Nonlinear Sci. 22(4), 479–487 (2012)MathSciNetGoogle Scholar
  26. 26.
    Richman, J.S., Moorman, J.R.: Physiological time-series analysis using approximate entropy and sample entropy. Am. J. Physiol. Heart Circ. Physiol. 278(6), H2039 (2000)CrossRefGoogle Scholar
  27. 27.
    Alcaraz, R., Rieta, J.J.: A review on sample entropy applications for the non-invasive analysis of atrial fibrillation electrocardiograms. Biomed. Signal Process. Control 5(1), 1–14 (2010)CrossRefGoogle Scholar
  28. 28.
    Lewis, M.J., Short, A.L.: Sample entropy of electrocardiographic RR and QT time-series data during rest and exercise. Physiol. Meas. 28(6), 731–744 (2007)CrossRefGoogle Scholar
  29. 29.
    Alangari, H.M., Sahakian, A.V.: Use of sample entropy approach to study heart rate variability in obstructive sleep apnea syndrome. IEEE Trans. Bio-med. Eng. 54(10), 1900–4 (2007)CrossRefGoogle Scholar
  30. 30.
    Platisa, M.M., Mazic, S., Nestorovic, Z., Gal, V.: Complexity of heartbeat interval series in young healthy trained and untrained men. Physiol. Meas. 29(4), 439–450 (2008)CrossRefGoogle Scholar
  31. 31.
    Zunino, L., Zanin, M., Tabak, B.M., Prez, D.G., Rosso, O.A.: Complexity-entropy causality plane: a useful approach to quantify the stock market inefficiency. Phys. A Stat. Mech. Its Appl. 389(9), 1891–1901 (2010)CrossRefGoogle Scholar
  32. 32.
    Staniek, M., Lehnertz, K.: Parameter selection for permutation entropy measurement. Int. J. Bifurc. Chaos 17(10), 3729–3733 (2007)CrossRefGoogle Scholar
  33. 33.
    Boeing, G.: Visual analysis of nonlinear dynamical systems: chaos, fractals, self-similarity and the limits of prediction. Systems 4(4), 37 (2016)CrossRefGoogle Scholar
  34. 34.
    Podobnik, B., Horvatic, D., Ng, A.L., Stanley, H.E., Ivanov, P.C.: Modeling long-range cross-correlations in two-component arfima and fiarch processes. Phys. A Stat. Mech. Its Appl. 387(15), 3954–3959 (2007)MathSciNetCrossRefGoogle Scholar
  35. 35.
    Hosking, J.: Fractional differencing. Biometrika 68(1), 165–176 (1981)MathSciNetCrossRefGoogle Scholar
  36. 36.
    May, R.: Simple mathematical models with very complicated dynamics. Nature 261(5560), 459–467 (1976)CrossRefGoogle Scholar
  37. 37.
    Granger, C., Joyeux, R.: An Introduction to Long-Memory Time Series Models and Fractional Differencing. Harvard University Press, Cambridge (2001)CrossRefGoogle Scholar
  38. 38.
    Tsay, R.: Analysis of Financial Time Series. Wiley, Hoboken (2002)CrossRefGoogle Scholar
  39. 39.
    Patil, A., Santhanam, M.S.: Random matrix approach to categorical data analysis. Phys. Rev. E Stat. Nonlinear Soft Matter Phys. 92(3), 032130 (2015)CrossRefGoogle Scholar
  40. 40.
    He, J., Shang, P.: Multidimensional scaling analysis of financial stocks based on Kronecker-delta dissimilarity. Commun. Nonlinear Sci. Numer. Simul. 63, 186–201 (2018)MathSciNetCrossRefGoogle Scholar
  41. 41.
    He, J., Shang, P., Xiong, H.: Multidimensional scaling analysis of financial time series based on modified cross-sample entropy methods. Phys. A Stat. Mech. Its Appl. 500, 210–221 (2018)MathSciNetCrossRefGoogle Scholar

Copyright information

© Springer Nature B.V. 2018

Authors and Affiliations

  1. 1.School of ScienceBeijing Jiaotong UniversityBeijingPeople’s Republic of China

Personalised recommendations