股市可以預測嗎 ?— 碎形觀點 Markets are unpredictable, but some exploitable 廖思善 Sy-Sang Liaw Department of Physics National Chung-Hsing Univ, Taiwan October, 2009
Taiwan Stock Index ( )
Dow Jones Industrial Average (DJIA index )
An example of time series
Fourier Transform
Fourier Transform on the flashing of fireflies Analysis method for regular sequences
FFT on chaotic time series External frequency produces no useful information.
A typical Random walk
Gaussian distributions Central Limit Theorem
Louis Bachelier (1870 – 1946) PhD thesis: The Theory of Speculation, (published 1900). Bachelier's work on random walks predated Einstein's celebrated study of Brownian motion by five years. Black-Scholes model (1997 Nobel prize) assumes the price follows a Brownian motion.
Fractals Benoit B. Mandelbrot (1975)
How long is the coast?
Infinite structures
D = 1.1 Fractal time series D = 1.3 D = 1.5 Random walk D = 1.7D = 1.9
Multifractals B.B. Mandelbrot
Distribution of returns Returns: R.N. Mantegna and H.E. Stanley, Nature 376, 46 (1995) This can not be explained by the Central limit theorem. Normal distribution Normal Markets
Log-periodic oscillation N. Vandewalle, M. Ausloos, et al, Eur. Phys. J. B4, 139 (1998)
Detrended Fluctuation Analysis(DFA) (1) Time sequence of length N is divided into non- overlapping intervals of length L (2) For each interval the linear trend is subtracted from the signal (3) Calculate the rms fluctuation F(L) of the detrended signal and F(L) is averaged over all intervals (4) The procedure is repeated for intervals of all length L<N (5) One expects where H stands for the Hurst exponent C.K. Peng, et al, Phys. Rev. E49, 1685 (1994)
Use of DFA on Polish stock index L. Czarnecki, D. Grech, and G. Pamula, Physica A387, 6801 (2008) Crush at March 1994 Crush at January 2008
Stochastic multi-agent model T. Lux and M. Marchesi, Nature 397, 498 (1999)
Empirical Mode Decomposition N.E. Huang and Z. Wu, Review of Geophysics 46, RG2006 (2008)
Fractal dimensions of Time series
Examples of fractal functions White noise D = 2.0 Riemann function D=1.226 Fractal Brownian motions D = 1.4 Weierstrass function D=1.8 Random walk D = 1.5
Calculations of the Fractal dimensions Hausdorff dimension Box-counting dimension (Shannon) Information dimension Correlation dimension Fractal dimension = Fractal dimension = None is geometrically intuitive.
Calculate fractal dimensions from turning angles Physica A388, 3100 (2009), Sy-Sang Liaw and Feng-Yuan Chiu
Fractal dimension of DJIA index Dow Jones Red: points Blue: points Black: points
mIRMD (modified inverse random midpoint displacement) : S=2 S=4 S=6 Midpoint displacement scale Calculate fractal dimensions from Midpoint displacements
Calculating fractal dimension using mIRMD White noise Weierstrass function D=1.8 summing 30, 15, 10, terms D = 2 - slope sin(100t)
Calculating fractal dimension using mIRMD Weierstrass function D=1.8 White noise sin(100t) Random walk D = 2 – slope for fractals
Fractal dimension of Taiwan stock index Red: IRMD Blue: mIRMD log(s)
S&P500 – 1986, 4/4 mIRMD log(s)
Mono-fractals Weierstrass function has single fractal dimension at every scale everywhere
Fractal dimension of S&P500 — at one minute intervals SP500—minutes (1987) D = 1.05 D = 1.40 Bi-fractal! 20 minutes Crossover at
Fractal dimension of S&P500-- minutes SP500—minutes (1992) D = 1.38 D = 1.09 Bi-fractal! 20 minutes
Fractal dimension of S&P500— minutes (September 1987) mIRMD DFA
Bi-fractals A special kind of scale-dependent fractal has one fractal dimension for small scales and the other fractal dimension for scales larger than a certain value. We will call these fractals, bi- fractals. Mono-fractals Mono-fractals such as the Weierstrass function and the trajectory of a random walk have single fractal dimension at every scale everywhere
Bi-fractals have been observed in many real data, including heart rate signals[1,2]; fluctuations of fatigue crack growth[3]; wind speed data[4]; precipitation and river runoff records[5]; stock indexes at one minute intervals[6] [1] T. Penzel, J.W. Kantelhardt, H.F. Becker, J.H. Peter, and A. Bunde, Comput. Cardiol., 30, 307 (2003). [2] S. Havlin, L.A.N. Amaral, Y. Ashkenazy, A.L. Goldberger, P.Ch. Ivanov, C.-K. Peng, and H.E. Stanley, and, Physica A274, 99 (1999). [3] N. Scafetta, A. Ray, and B.J. West, Physica A359, 1 (2006). [4] R.G. Kavasseri and R. Nagarajan, IEEE Trans. Circuits Syst., Part I: Fundamental Theory and Applications 51, 2255 (2004). [5] J.W. Kantelhardt, E. Koscielny-Bunde, D. Rybski, P. Braum, A. Bunde, and S. Havlin, J. Geophys. Res. 111, D01106 (2008). [6] Y. Liu, P. Cizeau, M. Meyer, C.-K. Peng, and H.E. Stanley, Physica A245, 437 (1997).
log( ) log(s) Stock index at one minute intervals S&P500 (1987) Taiwan stock index (2009 Jan-May) log(s)
Stock indexes are intrinsically Bi-fractals
Oct. 17 USA: S&P 500 (1987)
Artificial S&P 500 (1987) Replace every return by 0, +1, or, -1 according to its sign in real data
Bi-fractal property is preserved.
Sp1987 realSp1987 constant return
Generate bi-fractals dynamically Weakly persistent random walk model: up – up -- probability p > 0.5 up down – down – probability p > 0.5 down up – down – probability q up down – up – probability q down
Trajectories generated using the weakly persistent random model ( step length = 1 ) Black: p = 0.9, q = 0.5 Red: p = 0.8, q = 0.5 Blue: p = 0.7, q = 0.5 Brown: p = 0.6, q = 0.5 Log(S) Log( )
Trajectories built using the weakly persistent random model ( step length = random ) p = 0.8, q = 0.5p = 0.7, q = 0.5
S&P500 minutes 1987 before collapse S&P500 minutes 1987 after collapse Taiwan index minutes 2009 May Taiwan index minutes 2009 April
Taiwan
US sp500
Financial market is a weakly persistent random walk ! As a consequence, the financial market is intrinsically more unpredictable than random walks. The distribution of the returns, and accordingly, the general trend of the market, are mainly determined by external effects.
On the other hand … Short-range prediction is possible Because the stock market is weakly persistent, for many moments, one knows when the market will be up or down with more than 50% chance (probability p > 0.5), so that one can always profit in the stock market (if transaction cost is neglected.)
Profits gained based on the weakly persistent random walk model S&P Net gain at selling Net gain at buying 0 Average time interval between transactions is 10 minutes.
S&P Net gain at selling Net gain at buying
Profits gained based on the weakly persistent random walk model Taiwan stock index 2009 Jan-May Net gain at selling Net gain at buying 0
Profits gained based on the weakly persistent random walk model Random walk Net gain at selling Net gain at buying 0
Is the bi-fractal property universal for all stock indexes around the world? Australia_AORD 2008,9—2009,6 Brazil_BVSP 2008,9—2009,6 China_SSEC 2008,9—2009,6 France_CAC ,9—2009,6 Germany_XDAX 2008,9—2009,6 India_SENSEX 2008,9—2009,6 Japan_NIKKEI ,9—2009,6 Portugal_PSI ,9—2009,6 Taiwan_TAIEX 2008,9—2009,6 US_S&P ,1—1992,12
China
Brazil
India
Japan
Australia
France
Germany
Portugal
Is the bi-fractal property found in every single stock?
Combination of a few stocks
A category of stocks
Conclusions Markets are intrinsically unpredictable, but some are exploitable. WPRW does not work for single stocks. For a portfolio consisting of a few selected stocks, the WPRW is still a good model.
Thank you for your attention!