Professional Documents
Culture Documents
alberto.suarez@ii.uam.es
Financial time series
2
Financial time series modelling/ analysis
Modelling finacial time-series is not easy
Natural sciences
⌧ Not reproducible
⌧ Underlying model?
Inductive / statistical learning
⌧ Small data sets
⌧ Complex data
14000
12000
• Non-linear
10000
8000
• Non-stationarity 6000
• Non-gaussian
4000
2000
• Heteroskedastic 0
0 500 1000 1500 2000 2500 30
3
Two stylized facts (Timo Teräsvirta)
4
An example: IBEX35
5
Daily returns: IBEX35 (5 years)
6
Daily-returns distribution
7
Black-Scholes theory
In theory: Markets are efficient
Absence of arbitrage opportunities.
No systematic trends.
Very short term memory.
Model: Black-Scholes
Log of daily returns of an asset are distributed
according to a normal distribution.
Two parameters:
• Risk free interest rate.
• Volatility [ free parameter]
8
Is Black-Scholes a good model?
Advantages
Simple minimal model with only one free
parameter, the volatility. Volatility smile
Good pricing accuracy for at-the-money (European call)
Sonrisa de la volatilidad
options. 0.258
Implied volatility
0.256
Analytic pricing formulas for simple 0.254
derivatives. 0.252
Drawbacks: 0.25
0.248
0.24
Options on underlying with very low or 80 85 90 95 100 105 110
11
12
Failure of normal model: Heavy tails
13
14
Empirical evidence for leptokurtosis
0.24
0.235
Black-Scholes is insufficient to
0.225
0.22
underlying. 0.21
0.205
80 85 90 95 100 105 110 115 120
Incremented risk
Multiplicative factor in market
Risk estimates (Basel Accord
1988, 1996 ammendment)
15
Time series analysis
1
X t −1
X t −2 Learning
device
X̂ t
X t− p
17
Tasks in time series analysis
Obtaining data:
Selection of attributes: Choose relevant indicators
Data collection
⌧Discrete data: Grouping /averaging in time window
⌧Continuous data: Importance of sampling frequency
Preprocessing data
Clean data : Missing data, outliers
Normalization of data X t − µ ; X t − median ; 2 X t − ( X max + X min )
σ iq X max − X min
Eliminate trends /seasonality: Handle a-priori info explicit /
Stationary data. X t − X t −1; X t − X t −1 ; log X t
18
X t −1 X t −1
Parametric / non-parametric data analysis
Parametric
Formulate (restrictive) hypothesis dependent on a set of parameters
Find parameters by data-driven optimization [training set]
⌧Sensitivity analysis
⌧Uncertainty in estimated parameters
⌧Robustness
Validation of models [test set]
Non-Parametric
Consider a family of universal approximants
Fix architecture / parameters by data-driven optimization [training set]
⌧Sensitivity analysis
⌧Robustness
⌧Uncertainty
⌧Intelligibility
Validation of models [test set] 19
Classical models in time-series
E [( X t +τ − µ )( X t − µ )]= γ τ
20
Autorregressive+Moving average models
Autorregressive model for a time-series
[ p] [q]
X t = f ( X , u ; θ) + ut
t t
Vectors of delayed values:
[X ] = [ X
[m] +
t t −1 X t −2 X t −m ]
[u ] = [u
[m] +
t t −1 ut −2 ut −m ]
xt − 2 w2( 2 ) xˆ ( t )
wJ( 2 )
xt − D (1)
wJD
J
D
xˆt = ∑ w j f ∑ w jd xt −d + w j 0 ; θ j − c j ;
( 2) (1) (1)
j =1 d =1
Sigmoidal (logistic) Hyperbolicx tangent:
1 −x
e −e
f ( x) = f ( x) =
1 − e− x e x + e− x 22
ARMA(p,q) MLP
Input layer
1 θ1 Hidden layer(s)
θ2
Output layer
xt −1 w1( 2 )
xt − 2 w2( 2 ) xˆ ( t )
AR
w
wJ( 2 )
xt − p
delay
xˆt −1 J
p AR
xˆt −2 w MA xˆt = ∑ w j f ∑ w jd xt −d +
delay j =1 d =1
p
+ + ∑ wMA ( xt −d − x
ˆt − d ) + θ j
;
xˆt − q _ ut − q d =1
jd
delay 23
Mixture model
GATING
NETWORK
X t −1
MODEL 1 g1
X t −s g2
MODEL 2
X̂ t
σt2−1 Σ σˆ t2
gJ
σt2− s MODEL J
1
24
Gating Network
ˆ
r −1
hi = exp bi X t −1 + ∑ ai X t −k −1 − ci
ˆ
k =1
1 -c1
1 h1
Xˆ t −1
a1 h2
Xˆ t −2
ar-1
hJ −1
Xˆ t − r
J −1
hi
Probabilities gi = J −1 ; i = 1,2 ,… ( J − 1) gJ = 1 − ∑ g j
1+ ∑hj j =1
j =1 25
Hierarchical mixtures
r −1
exp b1 X t −1 + ∑ a1k X t −k −1 − c1
Input = Vector of Delayed values µ1 = k =1
r −1
1 + exp b1 X t −1 + ∑ a1k X t −k −1 − c1
k =1
µ 2 = 1 − µ1
µ1 µ2
r −1
exp b2 X t −1 + ∑ a2 k X t −k −1 − c2
µ1|1 = k =1
r −1
1 + exp b2 X t −1 + ∑ a2 k X t −k −1 − c2
µ1|1 µ2|1
MODEL 3 k =1
µ 2|1 = 1 − µ1|1
Intuition:
Implicitly market forecasts are made in terms of scenarios.
Each of these scenarios is characterized by an expected return
and a volatility.
Markets assign a different probability to each scenario.
Dynamical picture?
Direct time aggregation of the process yields a normal model (by
Central Limit Theorem).
It is possible to construct a discontinuous jump process
maintaining the mixture form. Not realistic.
30
Mixture of AR processes
31
Synthetic data: Example 1
0.8 200
0.7
0.6 150
0.5
0.4
100
0.3
0.2
50
0.1
0
−10 −8 −6 −4 −2 0 2 4 6 8 0
Contribucion de cada experto −10 −8 −6 −4 −2 0 2 4 6 8
32
LL Train LL Test K-S Test ECM Test
Model 1 fit
-17967 -18009 0 0.4645
Contributions
1
Histogram
140
Percentile plot10
g1
g2
0.9
120
0.8 5
100
0.7
0.6 0
80
Y Quantiles
0.5
60
0.4
−5
0.3 40
0.2
−10
20
0.1
0 0
−10 −8 −6 −4 −2 0 2 4 6 8 10 −15 −10 −5 0 5 10 −15
Contribucion de cada experto −10 −8 −6 −4 −2 0 2 4 6 8
X Quantiles
33
LL Train LL Test K-S Test ECM Test
Model 2 fit
-16675 -16755 0.9666 0.3164
0.8 160
4
0.7 140
2
0.6 120
Y Quantiles
0
0.5 100
−2
0.4 80
−4
0.3 60
−6
0.2 40
−8
0.1 20
−10
0 0 −10 −8 −6 −4 −2 0 2 4 6 8
−10 −8 −6 −4 −2 0 2 4 6 8 10 −10 −8 −6 −4 −2 0 2 4 6 8 X Quantiles
Contribucion de cada experto
34
AR(1) fit for Ibex35 (1200 +712 days)
35
AR(1) fit for Ibex35 (1200 +712 days)
36
MIX 2 AR(1) fit for Ibex35
37
MIX 3 AR(1) fit for Ibex35
38
Hierarchical MIX 3 AR(1) fit for Ibex35
39
Conclusions and perspectives
40
Mixture of ARCH processes
MixARCH X t = φ[+i ] ⋅ X [t m ] + u[ i ] (t ),
with probability g[i ] ( X [t r ] , θ[ i ] )
The model for the residuals is
u[ i ] (t ) = σ[ i ] (t ) Z t
2 + 2 [q]
σ ( t ) = κ i + α ⋅ [u ] ( t )
[i ] i [i ]
The quantities Z t are assumed to be N(0,1)
41
Mixture of GARCH processes
MixGARCH Xˆ t = φ[+i ] ⋅ X
ˆ [t m ] + u[ i ] (t ),
[r]
with probability g[ i ] ( X , θ[ i ] )
t
42
AR(1) / ARCH(1) for IBEX35
43
Residual correlations: ARCH(1)
44
Normality hypothesis: ARCH(1)
200
4
2 150
s
eil
t 0
n
au
Q 100
Y
-2
50
-4
-6 0
-6 -4 -2 0 2 4 6 -4 -3 -2 -1 0 1 2 3 4 5
X Qua ntile s
KS Test = 0.12
45
MIXARCH for IBEX35
Model 2 Xˆ t = 0.1380 Xˆ t −1 + σ t Z t
σ = 0.6820 + 0.03821( X t −1 − 0.1380 X t −2 )
2
t
2
ˆ ˆ
47
Normality hypothesis: MixARCH(1)
6
160
4
140
120
2
100
s
eil
t 0
n 80
ua
Q
Y
60
-2
40
-4
20
-6
-6 -4 -2 0 2 4 6 0
-3 -2 -1 0 1 2 3
X Qua ntile s
KS Test = 0.83
48
MIXARCH Model fit
49
AR(1) / GARCH(1,1) for IBEX35
0.8733σ 2
t −1
The quantities Zare
t assumed to follow a N(0,1)
distribution.
50
Residual correlations: GARCH
Autocorre la tions of re s idua ls
1
0.8
e 0.6
d
ut
i
n
g 0.4
a
M 0.2
0
0 5 10 15 20 25 30
250
6
4 200
2
s 150
eil
t
n
a 0
u
Q
Y 100
-2
50
-4
-6 0
-6 -4 -2 0 2 4 6 -4 -2 0 2 4 6
X Qua ntile s
KS Test = 0.56
52
Test Data
90
80
3
70
yt 2
60 ili
t
50
al 1
o
V
40
0
30
100 200 300 400 500 600
Time
20
10
0
Autocorre la tions of re s idua ls
-6 -4 -2 0 2 4 6
1
0.8
6 e
d 0.6
ut
i
KS = 0.33
ng 0.4
4 a
M 0.2
0
2
0 5 10 15 20 25 30
s Autocorre la tions of a bs (re s idua ls )
eil
t 0
n
ua 1
Q
Y 0.8
-2
e
d 0.6
ut
i
ng 0.4
-4
a
M 0.2
0
-6
-5 0 5 0 5 10 15 20 25 30
X Qua ntile s
De la y 53
MIXGARCH for IBEX35
Model 2 Xˆ t = 0.3314 Xˆ t −1 + σ t Z t
σ = 2.6230 + 0.0000( X t −1 − 0.3314 X t −2 ) + 0.0285 σt2−1
2
2
t
ˆ ˆ
1
0.8
e
d 0.6
ut
i
n
g 0.4
a
M 0.2
0
0 5 10 15 20 25 30
6
160
140
4
120
2
100
s
eil
80 t 0
n
a
u
Q
60 Y
-2
40
-4
20
0 -6
-3 -2 -1 0 1 2 3 -6 -4 -2 0 2 4 6
X Qua ntile s
KS test = 0.95
56
MIXGARCH Model fit
0.8
y 0.6
p
or 0.4
t
n 0.2
E
0
200 400 600 800 1000 1200
s 0.8
eit 0.6 Mode l 1
ili
b 0.4 Mode l 2
a
b 0.2
or
P 0
200 400 600 800 1000 1200
2
yt
iil
t 1
al
o
V
0
200 400 600 800 1000 1200
Time 57
Test Data
80
70
3
60
yt 2
ili
t
50 al 1
o
40
V
0
100 200 300 400 500 600
30
Time
20
2
KS = 0.25 Autocorre la tions of a bs (re s idua ls )
1
s 0.8
eil
t 0
n e
ua d 0.6
Q ut
Y i
ng 0.4
-2 a
M 0.2
0
-4
0 5 10 15 20 25 30
De la y
-6
-6 -4 -2 0 2 4 6
X Qua ntile s 58