A wavelet-based approach of the Athens stock market predictability


A wavelet-based approach of the Athens stock market predictability

A WAVELET-BASED APPROACH OFATHENS STOCK MARKET PREDICTABILITYEleni Avaritsioti 1Centre for Quantitative FinanceTanaka Business SchoolImperial Collegeof Science, Technology and MedicineTel: +30 6977455672E-mail: eleni.avaritsioti03@imperial.ac.ukAbstractA process has been developed, in the framework of my PhD work, for financialtime series prediction which employs the Discrete Wavelet Transform (DWT).The predicted wavelet coefficients at each decomposition level, are combinedthrough the Inverse DWT to calculate future values of the time series. Twowavelet filters have been used: the Haar and the Daubechies-4. The results frombacktesting experiments using historical data of four of the new sector-basedindices of ATHEX are compared to the ones obtained from an AR predictionmodel with an optimum number of lagged coefficients, according to the AkaikeInformation Criterion. Hit rate and RMSE have been used as measures offorecasting accuracy. Hit rates above 51% are reported with the Db-4 filter with amaximum of 60% for the Banks Index.IntroductionA number of models have been developed for time series prediction based onhistorical data as discussed and described by De Gooijer and Hyndman,2006.The most popular are the linear regression methods like autoregressive (AR),Autoregressive Moving Average (ARMA) and the Autoregressive Integratedmoving Average (ARIMA) discussed by Box and Jenkins, 1976 and Diebold,2004. An important requirement for the successful application of these models isthe existence of stationarity. Financial time series, however, exhibit complicatedpatterns and abrupt changes may be observed over time, because of trends,volatility clustering, etc. and their transformation to stationary ones requires ausually lengthy trial and error process and application of special tests. As analternative, the wavelet transform may be used given that many non-stationarytime series become stationary after wavelet transformations, see Marsy, 1993.Multi-resolution decomposition techniques such as the wavelet transform,(Ramsey, 1999) decompose a time series into different time scales as discussedby Gencay et al, 2002, so that they reveal seasonalities, discontinuities, volatilityclustering and they identify local and global dynamic properties of the process.Forecasting techniques have been proposed that use wavelet transforms toprocess the historical data; Fryzlewicz, 2003 employed the Maximal OverlapDiscrete Wavelet Transform (MODWT) and the Haar filter and Renaud et al,2005, proposed an “a trous” wavelet transform, which in essence is a non-1 Address for correspondence: 84, Salaminos Str., Brilissia 152 35, Athens, Greece.1

decimated DWT, based on the Haar wavelet with an arbitrary selection of detailcoefficients to be predicted. In this paper, we propose a new combinedprediction and filtering method, which can be seen as a bridge between thewavelet de-noising techniques and the wavelet predictive methods, using ARmodels to predict future values of detail coefficients from the values of the onesobtained by the multi-scale decomposition of a time series provided by the Haarand Daubechies-4 wavelets.The paper is organized as follows: a synopsis is made on the Discrete WaveletTransform (DWT) which decomposes a time series into wavelet coefficientswhich are subsequently thresholded for the de-noising or smoothing of financialtime series. The proposed prediction methodology that has been developed inthe wavelet domain is briefly described. Finally, the results of the backtestingexperiments, for three rolling window widths, obtained with especially developedC++ codes, are presented in terms of RMSE and Hit Rate values for the case offour financial indices of ATHEX.The Discrete Wavelet Transform (DWT)A dyadic “discretised” wavelet is given by:−m/ 2 −mψm, n( t) = 2 ψ (2 t − n), (1)where the control parameters m and n are contained in the set of all integers Z2(both positive negative and zero) and ψm, n∈ L ( R)is a real-valued function.Wavelets of this type are chosen to be orthonormal i.e. both orthogonal to eachother and normalized to have unit energy. The requirement of orthogonality isnecessary in order to diminish redundancy and to ensure that the resultsobtained from a wavelet transform of a signal are uncorrelated.Scaling functions are associated to the wavelets, which have the same form, i.e.−m/ 2 −mφm, n( t) = 2 φ(2 t − n), (2)2where φ,∈ L ( R ) is a real-valued function.m nMallat,1989 proved that at scale index m+1 there are coefficientshkandwhich satisfy the following identities with n ∈Z and for arbitrary integer values ofm:gk,φψ1( t) = ∑ h φ ( t)2m+ 1, n k m,2n+kk∈Z1( t) = ∑ g φ ( t)2m+ 1, n k m,2n+kk∈Z(3)(4)The first of these equations means that the scaling function at any arbitrary scaleis expressed in terms of a weighted sum of shifted scaling functions of the2

previous scale factored by their respective coefficients hk. These equations formthe basis for a decomposition algorithm as shown next. The approximationcoefficients cm,2n+ kfor each k and hence the approximation coefficients at scalem+1 can be calculated from the scaling coefficients of the previous scale m as:1cm+ 1, n= ∑ hk −2 ncm,k(5)2 kSimilarily, the wavelet coefficients at scale m+1 can be calculated from theapproximation coefficients of scale m as:1dm+ 1, n= ∑ gk −2 ncm,k(6)2 kSo, given the approximation coefficients at a scale m, the approximation anddetail coefficients at all scales can be calculated by repeating the two equationsabove. Mallat’s multiresolution analysis, represented by Eqs. (5) and (6), issimilar to the sub-band coding algorithm in signal processing. The sequencegk2n{ −( ) } is known as the high-pass or high-band filter followed by decimation2h −k 2nand the sequence { ( ) } is known as the low-pass or low band filter followed2by down-sampling represented by the factor 2n. Both filters belong to the FiniteImpulse Response (FIR) filters and they constitute Quadrature Mirror Filters.Repeating this process on the approximation coefficients, for several scales, isequivalent to the so-called cascading of filter banks.A signal reconstruction algorithm can be implemented by repeating theseequations in reverse order, i.e. calculating cm,nfrom cm + 1, nand dm + 1, nas:1 1c = h c + g d2 2∑ ∑ (7)m−1, n n−2 k m, k n−2 k m,kkkThe Haar wavelet system can be seeing as a filter of length L=2 that can bedefined by its scaling (low-pass) filter coefficients and by its wavelet (high-pass)filter coefficients, respectively as:h02and12h 0g g and12 2The Daubechies 4 is a filter of length L=4 with low-pass filter coefficients:and high-pass filter coefficients :h01+3 3 + 3 3−3= , h 1= , h2= , h3=4 441−34g1−33 − 33+31+3= h = , g1 = − h2= − , g2 = h1= , g3 = − h0= − .44440 33

Within-Scale De-correlation of Detail CoefficientsApplication of the DWT to the historical data decomposes them into variousresolution levels that reveal their underlying structure and it produces detailcoefficients at each one of the five decomposition leves which show a smallwithin-scale correlation that is reduced with increasing decomposition level, asshown if Figure 1. This has been used for the calculation of future values of detailcoefficients with an AIC optimised AR model.Figure 1: Auto-correlation of Detail Coefficients as a Function of DecompositionLevel for the BANKS IndexWavelet “De-noising”A time series may be de-noised by thresholding the detail coefficients at alldecomposition levels. The choice of the value of threshold is a very importantproblem given that a large value will destroy all significant features of thedecomposed signal leading thus to a reconstructed signal that does not resemblethe original one. The “optimum” value of the threshold level, λ , is calculatedaccording to Donoho, 1995 as:λ2= 2σlog( N)(8)2where N is the length of the decomposed vector, and σ is the variance of thenoise, which is estimated from the variance of the detailed coefficients at the firstdecomposition level. It is worth noting that the threshold level is a function of thevolatility exhibited by the time series under consideration; when volatility is zerothe threshold level is zero and as volatility increases the threshold level increasestoo. A second important point is that thresholding of the wavelet detailcoefficients does not remove the volatility but it suppresses it to a certain degreeso that the majority of the underlying features is preserved as it may beconfirmed by examining the descriptive statistics of the resulting residuals.Wavelet de-noising does not require any assumptions about the nature of theseries and allows for discontinuities and variations.The resulting ( n in number) thresholded detail coefficients (at decompositionsoftlevel j ) are given by: d [ n] = sign( d [ n]) ( d [ n] − λ).j j j4

Figure 2: Original and De-noised SeriesBanksInsuranceIndex Value5.5005.0004.5004.0003.5003.0002.5002.0001 52 103 154 205 256 307 358 409 460 511Number of PointsPrediction in the Wavelets DomainThe 512 daily values of the four new-sector indices of ATHEX, from 17/12/2003to 30/12/2005, are used as historical data. The first step of the predictionprocedure is to apply the DWT to the historical data with predefined a)rollingwindow width, b)number of decomposition levels, and c)Haar or the Daubechies-4 filter. The second step involves the estimation, at the jth decomposition level, ofone future value from the approximate coefficients using linear regression andone future value from the detail coefficients using an AR model. The third stepinvolves the estimation of the appropriate (at each level) number of future valuesof detail coefficients, and the fourth step involves the application of the IDWT tothe estimated future values.Forecasting Accuracy MeasuresThe forecasting accuracy has been evaluated with RMSE (a measure verysensitive to outliers in innovations) and Hit Rate (a practical measure) which arerespectively defined as:RMSE =1pp∑( actual(t)− predicted(t))t = 12whereTestSize1HR = ∑ SameDirection( ∆Ppred , t, ∆Pactual , t)TestSize t=2⎧1 if ∆Ppred , t≤ 0 and ∆Pactual , t≤ 0⎫⎪⎪SameDirection( ∆Ppred , t, ∆ Pactual , t) = ⎨1 if ∆Ppred , t≥ 0 and ∆Pactual , t≥ 0⎬⎪0otherwise⎪⎩⎭with ∆ Ppred , t= Ppred , t− Ppred , t−1∆ P = P − P−actual, t actual, t actual, t 1Prediction ResultsRMSE values, shown in Table 1, are relatively high due to the outliers existing inall of the four series. Hit rate values show a strong dependence on the rollingwindow length. This may be attributed to the relation of the window length to theperiod of the oscillations that exist in the data. Specifically, in the case of5

Insurance Index, window length of 128 working days, which is comparable to thestrong oscillations present, gives a hit rate of 58% a value that is reduced to 53%when different window lengths are used. On the contrary, in the case of BanksIndex which exhibits weaker oscillations of shorter period, as shown in Figure 2,the hit rate value of 60% has been obtained with the relatively wider rollingwindow length of 256.ATHEXIndexTable 1: Results from the Backtesting of the Proposed Prediction ProcessHaar Filter Db-4 Filter ARwindow 64 window 128 window 256 window 64 window 128 window 256 window 64RMSE HR RMSE HR RMSE HR RMSE HR RMSE HR RMSE HR RMSE HRBanks 58 0.54 54 0.55 55 0.56 49 0.52 49 0.52 52 0.60 84 0.000Telecoms 57 0.47 52 0.45 54 0.53 49 0.52 48 0.51 52 0.53 79 0.002Oil & Gas 66 0.50 62 0.52 69 0.53 55 0.52 55 0.52 64 0.52 97 0.000Insurance 82 0.52 74 0.54 75 0.51 69 0.53 69 0.58 73 0.54 123 0.002ConclusionsA forecasting process is proposed which in combination with the Daubechies 4filter predicts with a relative high degree of success all of the four sector-basedindices of ATHEX studied. The AIC optimised AR model used as benchmarkshowed zero predictability. The prediction success depends on the rollingwindow length as it was expected. Extension of the proposed process with theuse of Independent Component Analysis for the between-scale decorrelation ofdetail coefficients is expected to further improve the forecasting success.ReferencesBox, G.P. and G. M. Jenkins (1976). Time Series Analysis: Forecasting andControl, Holden-Day.De Gooijer, J.G. and R. J. Hyndman. (2006). 25 years of time series Forecasting.Int. Journal. of Forecasting, 22, 443-473.Diebold, Francis X. (2004). Elements of Forecasting. 3d Edition, Thomson South-Western.Donoho, D. L. (1995). Denoising via soft thresholding. IEEE transactions onInformation Theory, 41, 613-627.Fryzlewicz, P. (2003). Wavelet Techniques for Time Series and Poison Data. PhDDissertation, University of Bristol, U.K.Gencay, R., F. Selcuk and B. Whitcher (2002). An Introduction to Wavelets andOther Filtering Methods in Finance and Economics. Academic Press.Mallat, S.G. (1989). A theory for Multiresolution Signal Decomposition: TheWavelet Representation. IEEE Trans. On Pattern Analysis and MachineIntelligence, 11 (7), 674-692.Marsy, E. (1993).The wavelet transform of stochastic processes with stationaryincrements and its application to fractional Brownian motion. IEEETransactions on Information Theory, 39, 260-264.Ramsey, J. B. (1999). The contribution of wavelets to the analysis of economic andfinancial data. Phil.Trans. R. Soc. Lond. A 357, 2593-2606.Renaud, O., J.-L. Starck, and F. Murtagh. (2005). Wavelet-Based Combined SignalFiltering and Prediction. IEEE Transactions Systems, Man and Cybernetics,part B, 35(6), 1241-1251.6

More magazines by this user
Similar magazines