Eco No Metrics Forecasting 1999 - NonLinear Dynamics
Eco No Metrics Forecasting 1999 - NonLinear Dynamics
Nonlinear Dynamics
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 1
Overview
¾ Fractal distributions
¾ ARFIMA models
¾ Chaotic systems
¾ Phase space
¾ Correlation integrals
¾ Lyapunov exponents
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 2
Fractal Distributions
¾ Problems with Gaussian theory of financial
markets
Non-normal distribution of returns
• Fat tails
• Peaked
¾ Pareto (1897)
Found that proportion of people owning huge
amounts of wealth was far higher than predicted by
(log) normal distribution
“Fat-tails”
Many examples in nature
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 3
Pareto-Levy Distributions
¾ Levy (1935) generalized Pareto’s law
Described family of fat-tailed, high-peak pdf’s
¾ Pareto-Levy density functions
Ln[f(t)] = iδt - γ|t|α(1+iβ(t/|t|)tan(απ/2)
Parameters
• α is measure of peakedness
• β is measure of skewness (range +/- 1)
• γ is scale parameter
• δ is location parameter of the mean
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 4
Characteristics of Pareto-Levy
¾ α is fractal dimension of probability space
α=1/H
0<α<2
• If α = 2, (β = 0, γ = δ = 1) distribution is Normal
EMH: α = 2; FMH: 1 < α < 2
Self-similarity
• If distribution of daily returns has α = a, so will
distribution of 5-day returns
Variance undefined for 1 <= α < 2
Mean undefined for α < 1
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 5
Undefined Variance
¾ Example: Volatility in the S&P 500 Index
S&P 500 Index Roling 12 Month Volatility
200%
150%
100%
50%
0%
76
78
80
82
84
86
88
90
92
94
96
98
-
-
ar
ar
ar
ar
ar
ar
ar
ar
ar
ar
ar
ar
M
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 7
ARFIMA(0, d, 0)
¾ No short memory effects
¾ Long memory depends on parameter d
0 < d < 0.5: black noise
-0.5 < d < 0: pink noise
D = 0: white noise
D = 1: brown noise
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 8
ARFIMA(0, d, 0)
¾ d < 0.5
{yt} is stationary
Represented as infinite MA process
∞
yt = ∑ψ k ε t − k
k =0
(k + d − 1)!
ψk =
k!(d − 1)!
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 9
ARFIMA(0, d, 0)
¾ d > - 0.5
{yt} is invertible
Represented as infinite AR process
∞
yt = ∑ π k yt − k
k =1
(k − d − 1)!
πk =
k!(d − 1)!
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 10
ARMA(0, d, 0)
¾ Covariance (−1) k (−2d )!
γk =
(k − d )!(− k − d )!
¾ Correlation
(− d )! 2 d −1
ρk ~ k as k → ∞
(d − 1)!
¾ Partial Autocorrelation
d
φ kk =
k −d
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 11
ARFIMA(1, d, 0)
¾ Process: (1 - αB)∆dyt = εt
Combines long and short term memory processes
¾ Correlation function
(− d )!(1 + α ) k 2 d −1
ρk = ×
− α ) Ffunction
(d − 1is)!the(1Hypergeometric
F(a,b;C,z)
2
(1,1 + d ;1 − d ;α )
¾ Example: AR(1) vs. ARFIMA(1,d, 0)
AR(1): a = 0.711
ARFIMA(1, d, 0): d = 0.2, a = 0.5
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 12
AR(1) vs. ARFIMA(1, d, 0)
0.8
0.7
0.6
Correlation
0.5
0.4
0.3
AR(1)
0.2 ARFIMA(1,d,0)
0.1
0.0
0 5 10 15 20 25
Lag
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 13
Estimating ARFIMA Models
¾ Step 1
Estimate d in ARIMA(0, d, 0) model ∆dyt = εt
• Use R/S analysis to estimate d
¾ Step 2
Define ut = ∆dyt
Use box-Jenkins analysis to fit model αBut = βBεt
¾ Step 3
Define xt = (βB)-1(αB) yt
¾ Step 4: estimate d in model ∆dxt = εt
¾ Repeat steps 2-4 until parameters converge
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 14
Chaotic Systems
¾ Charaterized by:
Fractal dimension
Sensitivity to initial conditions
¾ Phase space
Scatter plot of system variables
Allows for visual inspection for patterns
¾ Attractors
Region in phase space where solutions lie
Can have Euclidean or fractal dimension
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 15
Example: Logistic-Delay Function
¾ Equation: Xt = aXt-1 (1-Xt-2)
¾ Attractor dimension
Depends on constant a
• Point attractor (spiral) for smaller values of a
• Limit cycle (ellipse) as a increases
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 16
Logistic Function: a = 1.8
The Logistic Function
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0.0
0.70
0.60
0.50
0.40
Xt-1
0.30
0.20
0.10
0.00
0.00 0.10 0.20 0.30 0.40 0.50 0.60 0.70
Xt
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 17
Logistic Function: a = 2.2
The Logistic Function
1.0
0.8
0.6
0.4
0.2
0.0
1.00
0.90
0.80
0.70
0.60
Xt-1
0.50
0.40
0.30
0.20
0.10
0.00
0.00 0.20 0.40 0.60 0.80 1.00
Xt
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 18
Fractal (“Strange”) Attractors
¾ Example: Henon attractor
¾ Equations
xt+1 = 1+yt - axt2
yt+1 = bxt
¾ Phase portrait shows strange attractor
Fractal dimension 1.2
1 < D < 2 indicates presence of 2 variables in system
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 19
Henon Attractor
Phase Portrait of the Henon Attractor
0.5
0.4
0.3
0.2
0.1
0.0
-1.5 -1.0 -0.5 -0.1 0.0 0.5 1.0 1.5
-0.2
-0.3
-0.4
-0.5
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 20
Strange Attractors in the Capital
Markets?
¾ Examine phase portrait of financial time series
Fractal attractor would indicate chaotic
(i.e. deterministic) process.
Dimension of attractor would indicate # of system
variables
¾ Problem:
What is dimensionality of phase space?
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 21
Constructing Phase Space
¾ Recall Henon attractor
Phase space constructed using scatterplot of two
variables X and Y
¾ Reconstruct phase space
Use scatterplot of Xt and Xt-1
Generates same map
Note: constructed using one variable, no equations
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 22
Reconstructed Phase Portrait
for Henon Attractor
Reconstucted Phase Portrait
1.5
1.0
0.5
Xt-1
0.0
-1.5 -1.0 -0.5 0.0 0.5 1.0 1.5
-0.5
-1.0
-1.5
Xt
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 23
Phase Space Dimensionality
¾ Ruelle: reconstructed vs. actual phase space
Same fractal dimension
Same Lyapunov spectrum
¾ Takens(1981):
Can reconstruct phase space by lagging time series for each
dimension
¾ Problem: what time lag to use?
i.e. What dimension is attractor?
• Need to embed it in higher dimension than its own
• Dimension of attractor does not change when embedded in higher
dimension (e.G. A plane in 3-D space still has 2-D)
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 24
Determining Embedding
Dimensionality
¾ Wolf: mt = Q
• M = embedding dimension
• T = time lag
• Q = mean orbital period
¾ Example
If period is 48 iterations we require:
• 2 points lagged 24 iterations in 2-D space
• 3 points lagged 16 iterations in 3-D space
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 25
Fractional Dimensionality
of Phase Space
¾ Time series
One variable
Dimensionality < 2
¾ Phase space
Includes all variables in system
Dimensionality depends on complexity of system
• May be > 3-D
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 26
Correlation Dimension
¾ Correlation integral
Grassberger & Procaccia (1983)
Measures probability that pair of points in attractor are
within distance R of one another
Approximates fractal dimension
N
1
Cm ( R ) = 2
N
∑ Z (R− | X
i , j =1
i − X j |)
i≠ j
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 27
Estimating the Correlation Integral
¾ As R increases, Cm(r) should increase in
proportion to RD
Cm(R) ~ RD
¾ Log[Cm(R) ] = const + Dlog(R)
¾ Procedure
Measure Cm(r) for increasing values of R
Log-log plot of Cm(r) vs R
OLS estimate of slope is correlation dimension D for
embedding dimension m
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 28
Correlation Integral of
the Henon Attractor
Correlation Dimension
0.0
-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4
-0.2
-0.4
y = 1.2014x - 0.5762
Log[Cm(R)]
-0.6
R2 = 0.999
-0.8
-1.0
-1.2
-1.4
-1.6
-1.8
Log(R)
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 29
BDS Test for Randomness
¾ Brock, Dechert, Scheinkman (1987)
Lag time series {yt, t = 1, . . , T} in N lagged series
• Reconstruct n-dimensional phase space a la Takens
CN(R,T) → C1(R)N as T→ ∞
BDS test statistic
0 .5
T
WN ( R, T ) =| C N ( R, T ) − C1 ( R, T ) N | ×
σ N ( R, T )
• σN(r,t) is the SD of the correlation integrals
• W ~ No(0,1)
• For large W, reject the hypothesis that series is random
– Note will detect both linear and non-linear, so typically use AR(1)
residuals to filter out linear effects
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 30
BDS Test of Financial Markets
Series Dimension W
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 31
Lab: Estimating the Correlation
Dimension for the S&P 500 Index
¾ Monthly S&P index returns (AR(1) residuals)
Cycle estimated at 42 months from R/S analysis
¾ Estimate correlation dimension
Use embedding dimensions m = 5 to 10
Lags = Int[42 / m]
¾ Chart log[Cm(r)] vs log(r)
• M = 5 to 10
¾ Regression analysis
Estimate phase space dimensionality D
• OLS estimate of slope in log(r) = Dlog[Cm(r)]
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 32
Solution: Estimating the Correlation
Dimension for the S&P 500 Index
Correlation Index of the S&P500 Index
0.0
-1.14 -1.12 -1.10 -1.08 -1.06 -1.04 -1.02 -1.00
Log(R)
-0.5
Log[C(r)]
-1.0
-1.5
-2.0
5 6 7 8 9 10 -2.5
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 33
Solution: Estimating the Correlation
Dimension for the S&P 500 Index
S&P 500 Index - Estimated Fractal Dimension
5.50
5.00
Correlation Dim ension
3.50
3.00
2.50
2.00
5 6 7 8 9 10
Em bedding Dim ension
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 34
Solution: Estimating the Correlation
Dimension for the S&P 500 Index
5 6 7 8 9 10
DEST 2.86 3.82 4.15 5.12 5.10 5.14
SE 0.029 0.043 0.017 0.058 0.029 0.045
t 98.45 88.13 247.26 88.19 174.43 114.02
p 0.000 0.000 0.000 0.000 0.000 0.000
R2 99.90% 99.87% 99.98% 99.87% 99.97% 99.92%
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 35
Other Studies of Fractal Dimension
¾ Peters (1991)
Criticized LeBaron Study
• Data insufficiency - would require 106 data points to estimate fractal
dimension reliably
• Use of returns not appropriate for study of non-linear effects
Used inflation-adjusted prices over 40 year period
¾ Findings
Equity Index Est. Dimension
US (S&P500) 2.33
Japan 3.05
Germany 2.41
UK 2.94
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 36
Lyapunov Exponents
¾ Measure of sensitivity to initial conditions
How rapidly nearby points in phase space diverge
(+ve) or converge (-ve)
One exponent for each dimension of phase space
• Linear dimension grows at rate 2L1t
• Area grows at rate 2(L1 + L2 )t etc.
¾ Equation Lyapunov exponent for ith dim. pi(t)
⎡1 ⎛ pi (t ) ⎞⎤
Li = Lim ⎢ Log 2 ⎜⎜ ⎟⎟⎥
t →∞ ⎣ t ⎝ pi (0) ⎠⎦
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 37
Lyapunov Exponents and Attractors
¾ Point attractors
3 negative exponents
¾ Limit cycles
2 negative, one zero exponent
• 2 dimensions that converge
¾ 3-D strange attractors
One positive, one zero, one negative
• Positive exponent shows sensitivity to initial conditions
• Negative exponent causes diverging point to remain in
range of attractor
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 38
Lyapunov Exponents and the
Capital Markets
¾ Strange attractor?
Positive exponent due to technical factors or
sentiment
Negative exponent due to fundamental value
• Brings prices back into “reasonable” range
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 39
Lyapunov Exponents and Time Series
¾ Find largest positive Lyapunov exponent L+
Measured in bits per day
Means we lose L+ bits of predictive power / day
¾ Example: L+ = 0.1
We lose 0.1 bits of predictive power / day
Suppose we can measure today’s conditions to 1 bit
precision
Information will lose all value after 1 / 0.1 = 10 days
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 40
Estimating the Largest
Lyapunov Exponent
¾ Wolf’s algorithm
Measures divergence of nearby points in
reconstructed phase space
Indicates how rate of divergence scales over fixed
intervals of time
Should converge to L+ if appropriate embedding
dimension m and time lag t are chosen
1 m ⎛ L' (t j +1 ) ⎞
L = ∑ Log 2 ⎜
+ ⎟
t j =1 ⎜ L(t ) ⎟
⎝ j ⎠
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 41
Largest Lyapunov Exponents of
International Equity Markets
Equity Lyapunov Indicated
Market (bit / month) Cycle (months)
S&P500 0.0241 42
UK 0.0280 36
Japan 0.0228 44
Germany 0.0168 60
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 42
Conclusions
¾ Long memory process
Confirmed by two independent methods of analysis
• R/S and Lyapunov
¾ Equity and bond markets - nonlinear systems
Aperiodic cycles
• E.g. Average cycle length 42 months in S&P 500 index
Strange attractors
• Fractal attractor dimension 2.33 (5.17)
Fractional noise short term (technical factors?)
Chaotic long term (fundamental analysis?)
¾ Currency markets have no cycle - black noise
Copyright © 1999 – 2006 Investment Analytics Forecasting Financial Markets – Nonlinear Dynamics Slide: 43