股市可以預測嗎 ?— 碎形觀點 markets are unpredictable, but some exploitable 廖思善...
TRANSCRIPT
股市可以預測嗎 ?—碎形觀點Markets are unpredictable,
but some exploitable
廖思善Sy-Sang Liaw
Department of PhysicsNational Chung-Hsing Univ, Taiwan
October, 2009
Taiwan Stock Index (1971-2005)
Dow Jones Industrial Average (DJIA index 1900-2007)
An example of time series
Fourier Transform
)7sin(9)4sin(24)3sin(6)sin(3.2)( xxxxxf
Fourier Transform on the flashing of fireflies
Analysis method for regular sequences
FFT on chaotic time series
)cos()()(
2)()( 3
2
2
tFtxdt
tdxtx
dt
txd
42.0,1,25.0,1,1 F
External frequency
produces no useful information.
A typical Random walk
Gaussian distributions
22 2/
4
1)(
xexf
2
)(0
dxxfx
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
http://www.fourmilab.ch/images/Romanesco/
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.7 D = 1.9
MultifractalsB.B. Mandelbrot
Distribution of returns
• Returns:
)()( tfttfr
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
)])log(cos(1)[log()( ttCttBAty cc
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
HLLF ~)(
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 modelT. 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 functionsWhite 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
= 2.315
Fractal dimension
= 2.731
None is geometrically intuitive.
Calculate fractal dimensions from turning angles
1
1
2
2
0,)()(2
1
)()()()(
2
1
k
k
oddjkjRjLk
oddj k
jkj
k
kjjkk
tftf
tftftftf
)1(1 2)(2 DkHkk
kk
Physica A388, 3100 (2009),
Sy-Sang Liaw and Feng-Yuan Chiu
Fractal dimension of DJIA index
Dow Jones 1900 - 2007
Red: points
Blue: points
Black: points
1213
1211 1212
)2(G )4(G
)log()2()(log( sDsG
2/1
2/
|2
)2/()2/()(|
1)(
sN
sx
sxfsxfxf
sNsG
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
))(log( sG
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( sG
log(s)
45.1D
Mono-fractalsWeierstrass 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-fractalsMono-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(<G(s)>)
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.
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(<G(s)>)
Trajectories built using the weakly persistent random model (step length = random)
p = 0.8, q = 0.5 p = 0.7, q = 0.5
Taiwan
US sp500
US sp500
US sp500
US sp500
US sp500
US sp500
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&P500 1987
Net gain at selling
Net gain at buying
0
Average time interval between transactions is 10 minutes.
S&P500 1987-1992
1986 1987 1988 1989 19921990 1991
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_CAC40 2008,9—2009,6
Germany_XDAX 2008,9—2009,6
India_SENSEX 2008,9—2009,6
Japan_NIKKEI225 2008,9—2009,6
Portugal_PSI20 2008,9—2009,6
Taiwan_TAIEX 2008,9—2009,6
US_S&P500 1986,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
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!