applications of rqa to financial time series f. strozzi 1, j. m. zaldívar 2 and j. p. zbilut 3 1...
TRANSCRIPT
Applications of RQA to Financial Time Series
F. Strozzi1, J. M. Zaldívar2 and J. P. Zbilut3
1Quantitative Methods Institute, Carlo Cattaneo University, Castellanza (VA), Italy2European Commission, DG Joint Research Centre, IES, Ispra (VA), Italy3Department of Molecular Biophysics and Physiology, Rush Medical College, Chicago, USA
Outline
• High frequency financial data sets
• Use of RQA (% Recurr) for detecting correlation between time series.
• Use of RQA (% Det, %Lam) to distinguish financial time series from surrogate (linearly correlated noise).
• Use of RQA (%Det, %Lam) for measuring volatility in financial data sets
• Conclusions
High Frequency Financial Data Sets
They are observations on financial variables taken daily or at a finer time scale.
They have been widely used to study market microstructures.
They are also useful for studying the statistical properties, volatility in particular, of asset returns at lower frequencies.
They are irregularly spaced and they need a preliminary treatment.
HFDF96, exchange rates -->correlationSpot electricity prices --> surrogate, volatility
Use of RQA for detecting correlation in exchange rates
• HFDF96: Olsen & Associates, high freqency, ½ h, Exchange rates between the US Dollar and 18 other foreign currencies from 1.1.1996-31.12.1996
• Belgium Franc (BEF)• Finnish Markka (FIM)• German Mark (DEM)• Spanish peseta (ESP)• French Frank (FRF)• Italian Lira (ITL)• Dutch Guilder (NLG)• ECU (XEU)• Australian Dollar (AUD)• Canadian Dollar (CAD) • Swiss Frank (CHF)• Danish Krone (DKK)• British Pound (GBP)• Malaysian Ringgit (MYR)• Japanese Yen (JPY)• Swedish Krona (SEK)• Singapore Dollar (SGD)• South African Rand (ZAR)
High Frequency exchange rates
Historical events in 1996:
• 14 October FIM joined ERM• 25 November ITL retunes in ERM
ERM=Exchange Rate Mechanism
logarithmic medium price ym 2
)log()log( askbidm
ppy
minmax
min
mm
mm
yy
yyy
normalised data [0-1]
• HFDF96
exchange rates: data treatment
• Time delay t (first minimum of the mutual information function): 232-283 i.e. 4.8-5.9 days.
• Embedding dimension dE using False Nearest Neighbour algorithm and E1&E2 methods: 7-14
t=260 dE =11
XEU
CHF
Epochs of 336 points (1 week) shifted by 48 points (1 day). Linear correlation coefficient
Correlation in HFDF96: %recurrence on epochs
AUD BEF CAD CHF DEM DKK ESP FIM FRF GPB ITL JPY MYR NLG SEK SGD XEU ZAR AUD 0.835 0.602 0.615 0.840 0.798 0.840 0.817 0.859 0.512 0.482 0.686 0.488 0.879 0.731 0.508 0.782 0.533 BEF 0.689 0.465 0.936 0.953 0.890 0.810 0.924 0.554 0.751 0.667 0.604 0.927 0.815 0.719 0.930 0.596 CAD 0.325 0.726 0.788 0.767 0.633 0.750 0.841 0.726 0.905 0.801 0.697 0.751 0.560 0.818 0.868 CHF 0.584 0.405 0.441 0.363 0.590 0.562 0.158 0.551 0.010 0.554 0.144 0.001 0.367 0.163 DEM 0.945 0.859 0.834 0.935 0.654 0.742 0.728 0.617 0.903 0.756 0.686 0.906 0.574 DKK 0.899 0.818 0.931 0.642 0.842 0.725 0.731 0.885 0.856 0.754 0.965 0.683 ESP 0.865 0.929 0.617 0.617 0.763 0.740 0.927 0.894 0.586 0.936 0.769 FIM 0.815 0.464 0.513 0.639 0.708 0.847 0.856 0.580 0.814 0.619 FRF 0.674 0.681 0.781 0.616 0.938 0.807 0.616 0.923 0.685 GPB 0.633 0.845 0.626 0.552 0.491 0.337 0.644 0.658 ITL 0.568 0.679 0.570 0.636 0.782 0.794 0.574 JPY 0.629 0.730 0.683 0.401 0.740 0.773 MYR 0.564 0.815 0.607 0.750 0.778 NLG 0.829 0.616 0.911 0.676 SEK 0.672 0.884 0.782 SGD 0.740 0.490 XEU 0.780 ZAR
%recurr: correlation coefficients for the high frequency currency exchange rates time series
Stable Distribution
0,2
1 ,2/10 ,1
A stable probability distribution is defined by the Fourier transform of its characteristic function t
:
dtetxf itx
2
1),,,;(
)sgn(1||exp tititt
1 t
1
)log()/2(
)2/tan(
Gaussian22 2
Chauchy Levy
(0,2], [-1,1] [0,) (-,)
is the tail index, β is a skewness parameter is a scale parameter, is a location parameter
Is it possible to distinguish between real and random stable distributed data?
• Using STABLE for univariate data http://www.cas.american.edu/~jpnolan
• We fitted the distribution of the first difference y(t+1)-y(t) with a stable distribution.
• All zeros values were eliminated. After they were introduced at the same locations in the random time series.
Data set Data set
AUD 1.57 -0.004 0.343 -0.556 GBP 1.54 -0.018 0.262 -0.386
BEF 1.46 0.005 0.405 0.939 ITL 1.45 0.018 0.583 -1.018
CAD 1.53 -0.038 0.508 1.845 JPY 1.61 0.010 0.386 0.535
CHF 1.56 0.060 0.296 0.029 MYR 1.42 0.005 0.368 -0.136
DEM 1.55 0.006 0.395 0.899 NLG 1.54 0.015 0.440 0.651
DKK 1.53 -0.018 0.518 1.555 SEK 1.44 0.010 0.746 0.138
ESP 1.32 0.004 0.492 0.998 SGD 1.50 0.016 0.628 -0.455
FIM 1.43 0.003 0.434 0.452 XEU 1.55 0.004 0.794 0.724
FRF 1.50 0.015 0.456 0.583 ZAR 1.26 0.044 0.173 0.050
Fitted density plot for the Japanese Yen (JPY) exchange rate data
Fitting and generating stochastic data with stable distributions
AUDsd BEFsd CADsd CHFsd DEMsd DKKsd ESPsd FIMsd FRFsd GPBsd ITLsd JPYsd MYRsd NLGsd SEKsd SGDsd XEUsd ZARsd
AUDsd 0.444 0.212 0.136 0.397 0.230 0.625 0.274 0235 0.045 0.055 0.463 0.430 0.109 0.191 0.227 0.207 0.021 BEFsd 0.387 0.234 0.480 0.568 0.639 0.388 0.120 0.334 0.186 0.073 0.390 0.166 4e-4 0.100 0.224 0.066 CADsd 0.228 0.192 0.597 0.272 0.415 0.062 0.167 0.223 0.050 0.329 0.132 0.125 0.349 0.128 0.135 CHFsd 0.288 0.406 0.086 0.222 0.008 0.039 0.369 0.064 0.001 0.413 0.083 0.035 0.033 0.069 DEMsd 0.115 0.240 0.199 0.046 0.139 0.283 0.121 0.344 0.200 0.169 0.145 0.163 0.170 DKKsd 0.439 0.468 0.075 0.177 0.064 0.158 0.078 0.148 0.230 0.113 0.300 0.270 ESPsd 0.638 0.331 0.464 0.020 0.152 0.259 0.242 0.090 0.232 0.157 0.290 FIMsd 0.164 0.448 0.144 0.210 0.068 0.340 0.255 0.523 0.132 0.613 FRFsd 0.368 0.115 0.004 0.026 0.391 0.646 0.024 0.335 0.024 GPBsd 0.011 0.359 0.094 0.517 0.099 0.004 0.487 0.254 ITLsd 0.045 0.196 0.337 0.132 0.239 0.187 0.244 JPYsd 0.181 0.328 0.135 0.077 0.342 0.113 MYRsd 0.141 0.190 0.201 0.464 0.368 NLGsd 0.144 0.114 0.506 0.371 SEKsd 0.224 0.093 0.454 SGDsd 0.195 0.426 XEUsd 0.184 ZARsd
Correlation coefficients for the stochastic time series with the same stable distribution and zeros
In 96 pairwise comparisons, over 153, on the currency exchange
rate time series, the values of the correlation coefficients are
higher than the higher value for the random time series, i.e.
0.646.
Comparison financial time series- stochastic stable distribution time series using RQA
nnnmedian /12/1/
Sign test: Null hypothesis: the median of correlation coefficient for real data is the same that the median of correlation coefficient for stable random data
the null hypothesis can be rejected at 5% level of significance if
nmedian refers to the number of observations lower than the median of random stable data. n is the total number of observations.
Figure 100. Plot of the %recurrence for the Euro and the Finnish Markka. Blue values before the entrance in the EMS, green values after the entrance.
Use of RQA to distinguish electricity spot prices from surrogate (linearly correlated noise).
Hourly spot prices in the Nordic electricity market (Nord Pool) from May 1992 until December 1998. (NOK/MWh)
Hourly spot prices in the Nordic electricity market (Nord Pool) from January 1999 until January 2007.(EUR/MWh)
SwedenNord Pool
Finland W Denmark E Denmark KontekNorway
Statnett Market
1996- EU Electricity Directive starts to have impact: EU countries open their electricity markets to competition ( high consumers can choose their provider).1993- Nord Pool (Nordic Electricity Market) was created by Norway.……2005-KT area. (Kontek cable connection Zealand-Germany). A competition starts between Nord Pool and European Energy Exchange (EEX)
High Frequency spot electricity prices
Spot electricity price: dependencies • The variation of the prices in the Nord Pool system is well correlated with the variations in precipitations because of its dependence from hydropower generation.• In the “dry” periods the price and its volatility increase due to the dependence from other source of energy (petrol)
Surrogate data: Null hypothesis
Linearly correlated noise. The null hypothesis : the time series are originated by a linear random process with the same autocorrelation function or, equivalently, with the same Fourier Power Spectrum.
t
q
kktkt
exax
1
et is un uncorrelated Gaussian noise of unit varianceis chosen so that the variance of the surrogates matches with the one of original dataak contain information on Correlation function
Surrogate data: discriminating statistic Q
The dynamic is chaotic? Q = Correlation dimensionQ = Lyapunov exponentQ = Forecasting error
Are there differencies in the RP structures?Q = RQA measures
Electricity spot prices: Recurrence Plots
EUR/KMh =13, dE =10, =10 NOK/MWh =15, dE=10, =40
Recurrence Plots: Surrogate linearly correlated
EUR/KMh =13, dE =10, =10 NOK/MWh =15, dE=10, =40
Data set %recur %deter maxline entropy trend % laminar TrapTime
Bnok 16.095 67.13 3545 8.593 -8.687 69.994 308.044
Surr001 8.150 6.129 4808 6.740 2.306 1.796 123.511
Surr002 1.926 4.521 1355 4.913 -0.142 0.000 -1
Surr003 2.807 8.026 4808 6.028 -1.616 0.000 -1
Surr004 30.218 36.309 4808 7.994 -3.360 35.521 214.805
Surr005 1.735 13.216 1844 6.117 -0.983 0.055 110
Surr006 1.007 32.018 1178 6.287 -0.752 16.980 166.134
Surr007 4.785 13.279 2674 6.895 -0.802 7.533 153.511
Surr008 14.122 17.880 4350 7.357 -4.479 9.293 154.815
Surr009 5.934 13.528 3130 7.195 -2.458 6.301 159.498
Surr010 1.193 5.900 1064 4.696 -0.677 0.347 119.500
Surr011 4.860 51.638 4808 7.918 -1.542 52.444 266.162
Surr012 31.899 52.675 4808 8.415 12.407 54.522 218.168
Surr013 4.795 9.417 4808 6.880 0.524 0.724 143.393
Surr014 5.725 9.169 4154 6.783 -2.980 1.774 144.963
Surr015 4.972 6.340 2370 6.606 -2.341 1.720 114.988
Surr016 18.050 23.404 4808 7.678 -4.183 12.845 161.470
Surr017 10.846 43.188 4614 8.799 -7.222 38.298 338.899
Surr018 4.956 8.523 4808 6.596 -2.654 3.484 141.553
Surr019 6.323 4.462 4808 6.184 -1.989 0.375 114.208
Surrogate: linear surrogate (NOK/MWh)
Data set %recur %deter maxline entropy trend % laminar TrapTime
Beur 7.12 35.33 2094 7.658 -4.587 33.94 263.525
Surr001 12.524 3.665 3340 6.355 -6.259 2.539 149.367
Surr002 1.643 5.894 2238 5.270 -1.100 1.872 119.367
Surr003 3.840 1.397 2150 4.533 -0.998 0.000 -1
Surr004 4.377 1.105 1324 3.970 -0.286 0.000 -1.000
Surr005 10.677 1.825 4187 5.730 -5.483 1.527 126.613
Surr006 8.658 18.813 4826 7.538 -5.638 9.854 146.364
Surr007 0.491 3.888 690 2.807 -0.346 0.000 -1.000
Surr008 23.790 11.105 4826 7.509 -7.639 9.252 162.159
Surr009 30.269 10.831 4826 7.393 -1.830 7.108 151.053
Surr010 20.536 4.700 4826 6.845 -7.466 6.416 150.611
Surr011 2.336 3.777 1888 5.094 -1.160 1.529 134.161
Surr012 3.715 1.475 3517 4.059 -1.627 0.108 117.250
Surr013 4.994 3.736 3721 5.972 -3.343 1.886 135.457
Surr014 21.649 9.020 4826 7.162 -2.900 9.664 154.810
Surr015 20.052 8.142 2669 7.247 -4.243 4.171 146.484
Surr016 6.811 5.384 3998 6.574 -4.098 0.758 125.312
Surr017 3.161 4.113 1964 5.641 -2.076 0.715 131.650
Surr018 7.809 3.369 2429 6.204 -0.473 2.766 132.437
Surr019 12.185 1.330 4826 5.429 1.503 0.088 125.600
Surrogate: linear surrogate (EUR/MWh)
Use of RQA for measuring volatility in electricity spot prices
Volatility
There are three main types of volatility:• Realized volatility, also called hystorical volatility determined by past
observation. Standard deviation of the change in value of a financial instrument with a specific time horizon .
• Model volatility: a virtual variable in a theoretical model such as GARCH or stochastic volatility.
• Implied volatility: a volatility forecast computed from market prices of derivatives such as options, based on a model of underlying process (such as log-normal random-walk).
Higher %determinism and %laminarity mean that the states of the system stay closer in time for longer periods forming diagonal or vertical segments in RP.
Hypothesis: higher %determinism or %laminarity implies smaller volatility
Volatility
Inverse of standard deviation and %determinism (top) and %laminarity (bottom) for NOK/MWh
Inverse of standard deviation and %determinism (top) and %laminarity (bottom) for EUR/MWh
720 point window (one month), data are shifted 720 points
Volatility: NOK/MWh
Nonlinear metrics of the Nord Pool spot prices time series in NOK/MWh: Values are computed from a 720 point window (one month), data are shifted 720 points. RQA parameters: t =15, dE=10, distance cutoff: max. distance between points/10, line definition: 100 points (~4 days). Vertical lines correspond to the following dates: 1st January 1993, 1st January 1996, 29th December 1997 and 1st July 1999 (see historical background).
Volatility: EUR/MWh
RQA measures of EUR/MWh: Values are computed from a 720 point window (one month), shifted of 720 points. RQA parameters: =13, dE=10, distance cutoff: max. distance between points/10, line
definition: 100 points (~4 days). Vertical lines correspond to the following dates: 1 st October 2000, 5th October 2005 (see historical background).
Conclusions Correlation (exchange rates)
• A method to assess the correlation between time series was developed based on %recurrence.
• Series in EUR zone (BEF, FIM, DEM, ESP, FRF, ITL, NLG) were highly correlated (R~0.9) in 1996 but also JPY-CAD-GPB.
• HFDF96 time series are more correlated than stable distribution random time series.
Surrogate (Electricity spot prices)
• Using RQA it is possible to distinguish between spot electricity prices and linearly correlated noise.
Volatility (Electricity spot price)
• %determinism & %laminarity could provide a new measure of volatility in financial time series.
• NOK/MWh
%Det-1/Std r2=0.4740
%Lam-1/Std r2=0.5809
%Lam-%Det r2=0.8804
Volatility: r2
• EUR/MWh
%Det-1/Std r2=0.4683
%Lam-1/Std r2=0.4512
%Lam-%Det r2=0.8870
%Det-1/Std, %Lam-1/Std
not very linearly correlated
The concept of recurrence plot (RP) was introduced by Eckmann et al. (1987) as follows:Let be the reconstructed delayed vector. Then, it is possible to define the distance matrix D asIf this Euclidean distance falls within a defined radius, r, the two vectors are considered to be recurrent and graphically this can be indicated by a dot.
jiij SSd ),....}2(),(),({)( ttsttststS
http://homepages.luc.edu/~cwebber/
Finnish Markka-US dollar (HFDF96) Malaysian Ringgit-US dollar (HFDF96) Swiss Franc-US dollar (HFDF96)
Recurrence Quantification Analysis (RQA)
To extend the original concept and made it more quantitative Zbilut and Webber (1992) developed a methodology called Recurrence Quantification Analysis. They defined several variables to quantify recurrence plots:
• %recurrence: percentage of colored pixels in the RP. Quantifies the amount of cyclic behaviour.• %determinism: Percentage of recurrent points which form lines parallelto the main diagonal. In the case of a deterministic system, these parallel linesare an indication of the trajectories being close in phase space for time scalesthat are equal to the length of these lines. •%laminarity : measures the percentage of vertical lines which indicate the occurrence of laminar states i.e., periods of tranquility or slowly drifting dynamics.• entropy: Shanon entropy of line segments distributions. Quantifies the richness of deterministic structure.• trend: measure of the recurrence points away from the central diagonal. It is a measure of non stationarity.• trap time: The average length of all vertical lines, indicating an average time the system is “trapped" into a laminar state as defined above•1/linemax: reciprocal of the longest diagonal line segment, related to largest positive local Lyapunov exponent (Trulla et al., 1996)
Introduction: Recurrence Quantification Analysis (RQA)
Volatility
Data set %recur %deter maxline entropy trend % laminar TrapTime
Bnok 16.095 67.13 3545 8.593 -8.687 69.687 308.044
Surr001 0 0 -1 -1 0 0 -1
Surr002 0 0 -1 -1 0 0 -1
Surr003 0 0 -1 -1 0 0 -1
Surr004
Surr005
Surr006
Surr007
Surr008
Surr009
Surr010
Surr011
Surr012
Surr013
Surr014
Surr015
Surr016
Surr017
Surr018
Surr019
Surrogate: temporally uncorrelated
Recurrence Plots: Surrogate Temporally uncorrelated
EUR/KMh =13, dE =10, =10 NOK/MWh =15, dE=10, =40
Norway Sweden
Finland W Denmark E Denmark Kontek
NOK/MWh EUR/MWh
720 point window (one month), data are shifted 720 points
Use of RQA for measuring volatility in electricity spot prices