Forecasting volatility data based on Wavelet ...

8 downloads 6 Views 868KB Size Report
Dec 7, 2010 - Mohd Tahir Ismail and d. Alsaidi M. AItaher a, ... cUniversiti Teknologi Petronas, 31750 Bandar Seri Iskandar, Tronoh, Perak, Malaysia. E-mail: ...
2010 International Conference on Science and Social Research (CSSR 2010), December

5

-

7,

2010, Kuala Lumpur, Malaysia

Forecasting volatility data based on Wavelet transforms and ARIMA model

d b as. AI Wadi, Mohd Tahir Ismail and Alsaidi M. AItaher bd a, , School of Mathematical science, Universiti sains Malaysia, 11800 Minden, Penang, Malaysia E-mail: [email protected]@cs.usm.my [email protected] cSamsul Ariffin Addul Karim, cUniversiti Teknologi Petronas, 31750 Bandar Seri Iskandar, Tronoh, Perak, Malaysia E-mail: [email protected]

Abslracl- this article suggests a novel technique for forecasting

potential future losses of a portfolio of assets, and in order to

the volatility data based on Wavelet transforms and ARIMA

measure these potential losses, estimates must be made of

model.

The

volatility

data

are

decomposed

via

Wavelet

future volatilities and correlations [21].

transforms. Then, the future observations of this series are

Recently, wavelet transforms are used for filtering time series

forecasted using a suitable and best fitted ARIMA model. Daily

representing. Wavelet analysis has grows very quickly in the

prices from Amman Stocks Market (Jordan) from 1993 until

recent years and more recently Wall Street analysts have

2009 are used in this study.

Keywords- Wavelet transform; forecasting. I.

ARIMA

started using mathematical models to analyze their financial

model; volatility data;

data. Wavelet analysis also has been used in signal processing (time

INTRODUCTION (HEADING 1 )

(typically three to six) of constitutive series. These series show

has gotten high attention in financial time series and financial

a better behavior than the original price series. Besides, it is

researchers. Forecasting stocks market is difficult because

more stable in variance and no outliers. Wavelet transform is

unlike demand series, price series present such characteristics

more efficient than Fourier transform ([3, 5, 6, 8, 1 1 , 12, 13]).

as inconstant mean and variance and significant outliers.

For this, wavelet transform can be used to analyze nonlinear

The developing economies are facing many impediments in

and non-stationary time series signals, useful in identifying

their financial markets, and with many other factors, high

transient events, used to filtering the denoise data to get more

volatility in prices which also considered as high risk or

accurately data, providing decomposition of a time series into

uncertainty is a major factor of erosion of capital from

several components from different scale and appears their

markets. As due to this the investors become fearful and run

correlation as a function on scale and time (localized in both).

away from the market. Though it is not the sign of inefficiency

Therefore, to show the efficiency of wavelet transform, this

of market, it poses a threat to 'crash' the market due to high

paper will introduce the ARIMA wavelet transform (AWT)

volatility. High volatility creates a high uncertainty in a stock

and ARIMA models then demonstrate that ARIMA wavelet

market and individual security prices and these may curtail

transforms is better than ARIMA models in forecasting

down the prices and associated returns. The stock market

volatility data. We will use MATLAB and SAS programming

volatility caused by number of factors such as: credit policy,

to obtain some of numerical and statistical results. In order to

inflation rate, interest, financial leverage, corporate earnings, yield

macroeconomic

policies, where

bonds

social

prices

and

and

political

recognition, decomposition,

the wavelet transform converts the financial series in a set

Stocks markets forecasting i s required for the investors and it

dividends

scale analysis), pattern

approximation techniques and quantum field [12]. Moreover,

many

illustrate the effectiveness of wavelet transforms, the Amman

other

variables

Stocks Market data sets are selected for discussion. We

are

consider a daily volatility for time period from 1993 (the days

involved. Madhavan (1992) [16] defines volatility in terms of

when stocks exchanges were open) until 2009 with a total of

price variance. Low volatility is preferred as it reduces

4096 observations. The total number of observations for ) mathematical convenience is suggested to be divisible by 2 .

unnecessary risk borne by investors thus enables market traders to liquidate their assets without large price movements.

It

Glen (1994) defines volatility as the frequency and magnitude

means

that

the

data

should

satisfy

the

condition of

of price movements and comparing the various microstructure

) observations= 2 ,j

attributes argues that liquid and efficient markets have less

the data set until level 12 (4096=212 observations) [14 , 10].

=

0 ,1,2, ... . Therefore, we can decompose

volatility than illiquid and inefficient markets. [15]Amihud et al. (1990) finds a reduced volatility in the Tel Aviv market as the market adopted a more continuous trading system.

II.

The three main purposes of forecasting volatility are for risk

The main aim of using Fourier transform, wavelet transform

management, for asset allocation, and for taking bets on future

and the other filtering methods is to represent the original time-

volatility. A large part of risk management is measuring the

978-1-4244-8986-2/10/$26.00 ©2010 IEEE

BASIC CONCEPT

86

series as a new sequence, which appears and explains the

l =J2 'f ¢(/)¢(2/-k)dl k -00

importance of each frequency components, trends, magnitudes, fluctuations and deferent requirements in the dynamics of the

=

{

1

O:o::t:O::l

'

0,

otherwise

original series. We will start this section by explaining the Haar And forN=2,

wavelet transforms and Daubechies wavelet transform. For more details and examples refer to [4].

Note: the mother wavelet satisfies the following conditions: 2.1 Wavelet transforms 00

� If(t)dt=0,

Consider the following function:

_

1

(t)=22 1f(2jt-k), j,kEZ; z={O,1,2,.... }. (1) If k j, Where;

If/

d(O

_

< 00.

Coiflets Wavelet. Haar wavelet is the simplest and oldest

For examples and details; refer

If/ is

lfl «(0)

example for the wavelet transform then this method was improved by Daubechies transformation, Daubechies (1992)

-00

to [7, 10]. The oldest and simplest example of

_

I 1 � 1(01

00 < 00,

The most popular types of orthogonal wavelets transform are:

00

f 1f(/)d1 =0 .

� 1 1f(t)1

Haar Wavelet, Daubechies Wavelet, Symmlets Wavelet and

is a real valued function having a compactly

supported, and

00

2

[9] developed the frequency - domain characteristics of the the Haar

Haar Wavelet. Actually there was no specific formula for this

wavelet, defined as:

type of wavelet. Thus, we have to use the square gain function

[

of their scaling filter (Iow- pass) by the following equation to determine the class [12].

1 0:0:: /:0::-

I,

2

H

If (I)= -L 0,

1 -:0::1 :0::1

g(j) =2 cos

(2)

2

1

LI 1 (trf) 2� -2-1 + I / o I

Qkrwise

J

calculate

the

wavelet

fimction,

we

use

the

dilation

This article includes some application of ARMA models in

¢(/)=fiI1d(21 -k), k If(t)=J2I hk¢(2t-k). k

is the father wavelet,

forecasting

(3)

economic

variables,

its

merits,

demerits

and

advantages of the model in comparison with conventional time series models. ARMA is the acronym for "Autoregressive Moving Average", invented by two great Statisticians George

(4)

Previously, we defined father and mother wavelets in

¢( 21 -k)

([12,18, 19,20]).

2.2 ARIMA Model:

equations, given as:

(4) where

(trf)·

I: Represents the length of the filter and should be a positive number. For more details and examples see

To

1

sin 2

1f(/) is

(3)

Box and Gwilym Jenkins and hence ARMA models are also

and

known as Box and Jenkins models [17].

the mother

ARMA models are

suitable for high frequency data. Since most of the economic

wavelet. Father is used to represent the high scale smooth

time

components of the signal, while the mother wavelets display

differencing is employed to convert non stationary data into

series

data

are

non-stationary,

a

method

called

the deviations from the smooth components. In other words,

stationary. The differenced series is regressed on to the original

the father wavelet generates the scaling coefficients and mother

series

wavelet gives the differencing coefficients. We define the

Regressive Integrated Moving Average).

father wavelets as lower pass filter coefficients mother wavelets as high pass filters coefficients

(hk)

then

ARMA

model

becomes

ARIMA (Auto ARIMA models

produce accurate forecasts based on the historical patterns of

and the

the time series data. ARIMA belongs to the class of linear

(lk ) [9].

l =J2 'f ¢«('I/J(2t-k)dt, k -00

and

models and can represent both stationary and non-stationary data. ARIMA models do not involve the dependent variable;

(5)

instead they make use of information in the series to generate the series itself. Stationary series is the one which vary about a fixed value whereas non-stationary series do not vary about a

(6)

fixed value. For more details; refer to ([1,

-00

2,17]).

However, quadrature mirror filters (QMF) is other concept There are a huge Variety of ARIMA models. The general non­

related to the wavelet transform, it has some a good ability to reconstruct the signals perfectly without aliasing effects.

seasonal model is known as ARIMA (p, d, q) [ 22]:

For the Haar wavelet:

AR: P= order of the autoregressive part. I

: d= degree of first degree involved.

MA: q= order of the moving average part.

87

If non- stationary is added to a mixed ARMA model, and then the general ARIMA (p, d, q) is obtained. The equation for the simplest case ARIMA (1,1,1) is as following:

Once the model adequacy is established, the series in question shall be forecasted for specified period. It is always advisable to keep tracking on the forecast errors and depending on the magnitude of errors, the model shall be re-evaluated. 2.3. Volatility: Researchers have already improved a lot of the definitions about volatility. Firstly, the most popular method is the standard deviation as a traditional technique. Secondly, the difference in the price results between up and down. Practically, both of them have the similar results. Therefore, in this paper we use the second definition since it is considered as a modern technique. In other words, it is defined as the absolute value of the daily return. It is mathematically expressed as [12]:

The model building process involves the following steps [22]: Model identification: The first step is to determine whether the time series data is stationary or non- stationary. The stationarity can be assessed either using Dickey Fuller test or run sequence plots. If the original series has no trend (stationary) then the series is an ideal candidate for ARIMA. If the original series has trend (non-stationary), the series can be converted to stationary by differencing the series. The order of differencing is zero for a stationary series and greater than zero for non- stationary series. •

vt = III.

PROCEDURE AND RESULTS

The Prediction technique for the volatility time series data taken from Amman stocks market works as follows. First step: transform the original data through the wavelet transform based on Haar wavelet transform and Daubechies wavelet transform (db2). Second step: evaluate the volatility data for the transformed data. Third step: select the fitted ARIMA models for the approximation Haar wavelet series and Daubechies wavelet series, after that, make the forecasting for the future data for each approximation series. Fourth step: select the fitted ARIMA model to the original volatility series (before the transformation). Fifth step: compare all of these results and decide the best model.

Model parameter estimation: The estimation of parameters is very importance in the model building. The parameters thus obtained are estimated statistically by the method of least squares. A t-statistic shall be employed to test the parameters significance. •

Model Diagnostics: Once the parameters are statistically estimated, before forecasting the series, it is necessary to check the adequacy of the tentatively identified model. The model is declared adequate if the residuals cannot improve forecast anymore. In other words, residuals are random. To check the overall model adequacy,the Ljung-Box Statistic is employed which follows a Chi-Square distribution. The null hypothesis is either rejected or not rejected based on the low or high p-value associated with the Statistic. •



h l = l log(xt)-log(xt_I) I ·

Forecasting:

Prediction errors for F2 D,D2D D,D 15 D,DID D,DD5 D,DDO -0,005 - D,0 10 -0,0 15 500

1500

1DDD

88

2500

JDDD

3500

�D95

Fig.I. forecasting error before the transformation

Prediction err 0 rs for VDLCA1 o , 10 O,OB o ,0 6 0, D4 0,02 0,00 -0,02 -0, D4 •

1



200

400

600

800

1000

1200





1400

1600



1800

200047

Fig.2. forecasting errors after transforming the data via Haar Wavelet transform.

Prediction errors for VDL082 o ,0 6 0, D4 0,02 0,00 +-....--------------------------1 ,. -0,02 -O,H -0,0 6 -O,OB

.

1

200

400

.

600

800

1000

.

1200

1400

1600

.

1800

Fig.2. forecasting errors after transforming the data via Daubechies Wavelet transform.

89

.

200048

the fiItted ARIMA modeI be r.ore and after the trans ormatIOn Value after transforms Value before transformation Daubechies wavelet transform Haar wavelet transform

Table. 1 StatlstlcaIPropertI es

Statistics of fit

0f

Mean square error

7.41951E-6

5.675E-6

7.82381E-6

Root mean square error

0.0027239

0.00238

0.0027971

Mean absolute error

0.0002457

0.0002200

0.0019719

[6]

The volatility data for Amman stocks market has been used as case study. Price forecasting is performed using daily data.

wavelet pairs, Signal Processing 85. 2005. pp. 2065-2081.

Moreover, for the sake of fair comparison the same sample

[7]

data are selected. (From 1993-2009). The fitted ARIMA model

for

the

ARIMA(2,0,2)

original with

volatility

root

mean

data

is

square

considered error

equal

[8]

as

D.E. Newland, , An Introduction to Random Vibrations Spectral and Wavelet Analysis (third ed). Prentice-Hall. Englewood Cliffs, NJ. 1993.

to

[9]

I. Daubechies, Ten Lectures on Wavelets, PA. SIAM and Philadelphia. 1992.

model for the transform data by using Haar wavelet transform

[10] Philippe Masset. Analysis of Financial Time-Series Using Fourier and Wavelet Methods. University of Fribourg (Switzerland) - Faculty of

with root mean square error

Economics and Social Science. 2008.

equal to (0.00238)as presented in table 1 also. Although the fit

[11] P.Manchanda,

ARIMA model for the transform data by using Daubechies wavelet transform is selected as ARIMA (2,1,0)

Chang Chiann and Pedro A. Moretin. A wavelet analysis for time series, Nonparametric Statistics. 1998. 10 pp: 1-46.

(0.0027971) as presented in table 1, while the fit ARIMA is selected as ARIMA (1,0,0)

Brandon Whitchera, Peter F. Craigmileb and Peter Brownc. Time varying spectral analysis in neurophysiologic time series using Hilbert

lKumar,

A.H.Siddiqi

Mathematical

methods

for

modeling price fluctuations of financial time series. Journal of Franklin

with root

institute. 2007. 344, pp: 613-363. [12] Gencay, R., F. Seluk and B. Whitcher. An Introduction to Wavelets and

mean square error equal to (0.0027239). Table 1 shows some

Other Filtering Methods in Finance and Economics, Academic Press,

other criteria about these results. All of these criteria explain

New York. 2002.

that the Wavelet-ARIMA model is better than the ARIMA

[13] S.Mallat. A Wavelet Tour of Signal Processing. Academic Press, San Diego.200 I.

model. Moreover, the Haar wavelet transform gives more

[14] Todd Wittman. Time-Series Clustering and Association Analysis of

sufficient result and better than Daubechies wavelet transform

Financial Data, CS 8980 Project.2002.

in the forecasting.

[15] Y. Amihud, H. Mendelson and M. Murgia. Stock market microstructure and return volatility: evidence from Italy. Journalof

VI.

Banking and Finance. 1990, 14: 423-440.

CONCLUSION

[16] A. Madhavan. Trading mechanisms in securities markets. Journal of

As conclusion for this article, if the Wavelet transform is used

Finance.1992, XLVIl(2), 607-641.

for the volatility data, then there is no outlier, seasonal effects and

other

irregular

effects.

Generally

the

result

of

[17] G. Janacek, and L. Swift. Time series forecasting, simulation and

the

applications. Ellis Hoewood limited. England. 1993. [18] Y. Motohiro. Measure business cycle: A wavelet analysis of economic

approximation series under the wavelet transforms is better

time series. Economics letter. 2008, 100:208

than the original series and more stable in variance, mean and

212.

no outliers. Furthermore, the forecasting by using ARIMA (p, d, q)

[19] Zbigniew

under the transforms is better than the forecasting

series

International

Finance

Corporation Discussion. 1994. Paper

No. 2

Washington D.e. IFe. [22]Spyros Makridakis, Steven e. Wheelwright and Rob J. Hyndman. Forecasting methods and applications. Third edition. John Wiley

J.Contreras, R. Espinola, F. J. Nogales, and A. J. Conejo. "ARIMA

Sons, Inc. New York. 1998.

models to predict next-day electricity prices," IEEE Trans. Power Syst,2003.vol. 18, no. 3, pp. 1014-1020. F. J. Nogales, J. Contreras, A. J. Conejo, and R. Espinola. "Forecasting next-day electricity prices by time series models," IEEE Trans. Power Syst. 2002 , vol. 17, no. 2, pp. 342-348. Arneodo, A., B. Audit, N. Decoster, J.F. Muzy and e. Vaillant. Wavelet­ based multiracial formalism: applications to DNA sequences. Springer, Berlin pp. 27-102. 2002. A.H. Siddiqi. Applied Functional Analysis, Marcel Dekker, New York. 2004. A.Razdan. Wavelet correlation coefficient of strongly correlated time series, Physics A.2004,

time

learning and cybernetics, Dalian, 13-16 August 2006.

REFERENCES

[5]

(financial)

[21] J., Glen. An introduction to the microstructure of emerging markets.

and USM fellowship scheme

[4]

in

Sui. The research of insurance income forecast based on wavelet

ACKNOWLEDGEMENT

[3]

methods

analysis. Proceedings of the fifth international conference on machine

The authors would like to thanks USM for financial support

[2]

Wavelet

[20] Bin-Sheng Liu, Yi-Jun Li, Hai-Tao Yang, Yu-Peng Hou and Xue-Shen

directly as well as it gives more accuracy results.

[1]

R.Struzik.

processing. Physica A. 2001, 296:307-319.

333, pp: 335-342.

90

&