You are on page 1of 3

2009 International Conference on Computational Intelligence and Natural Computing

Forecasting Stock Returns Based on Spline Wavelet Support Vector

LingBing Tang HuanYe Sheng


Department of Computer and Electronic Engineering
Hunan Business College Department of Computer Science and Engineering
Changsha, China Shanghai Jiao Tong University
Department of Computer Science and Engineering Shanghai, China
Shanghai Jiao Tong University hysheng@sjtu.edu.cn
Shanghai, China
lingbingtang@gmail.com

Abstract—Stock returns forecast is vital important in describe stock time series both at various locations and at
finance to reduce risk and take better decisions. This paper varying time granularities [5,6,11,12], it should describe the
propose a spline wavelet kernel for support vector machine cluster feature of volatility well. One of the basic methods
(SVM), called spline wavelet support vector machine for constructing wavelets involves the use of spline functions,
(SWSVM), to model nonstationary financial time series. which are probably the simplest functions with small
The SWSVM is obtained by incorporating the spline supports that are most efficient for both software and
wavelet theory into SVM. Because spline wavelet function hardware implementation [3,4]. Therefore, it is valuable for
can yield features that describe of the stock time series both us to research the problem of whether a desirable
at various locations and at varying time granularities, the performance could be achieved if we combine SVM with
spline wavelet theory. In this paper, we construct a novel
SWSVM can forecast stock returns accurately. The
spline wavelet kernel for SVM to forecast the stock returns.
applicability and validity of spline wavelet support vector
machine (SWSVM) for stock returns forecast were analyzed II. SPLINE WAVELET KERNEL AND SWSVM
through experiments on real-world stock data. It appears
Theorem 1: Let x ∈ R , the scaling function ϕ
(N )
that the spline wavelet kernel perform better than the ( x) is B-
Gaussian kernel. spline of the order ( N − 1) with the compact support
Keywords: Stock returns forecasting; Spline Wavelet support
vector machine (SWSVM); [ ]
interval 0, N and the integer division { xk = k , k ∈ Z } ,
the recursion formula is valid [22]
I. INTRODUCTION x − k ( N −1) k + N − x ( N −1)
ϕk( N ) ( x) = ϕk ( x) + ϕk +1 ( x), N = 2,3,...,
Time series prediction can be a very useful in the field of N −1 N −1 (1)
finance to forecast and study the behavior of stock price in ⎧1, k ≤ x < k + 1
time [21]. This creates the possibility to give early warnings ϕk(1) ( x) = N[ k , k +1) ( x) = ⎨
of possible risk or take better decisions. It is also important ⎩0, otherwise,
where ϕk ( x) = ϕ ( N ) ( x − k ).
(N )
to understand how prices behave for option pricing.
Successful applications in many studies have shown that
Theorem 2: Compactly supported spline-
neural networks can be powerful tools for time series
modeling and forecasting [1,7,8,10,13]. Compared with wavelet ψ ( x) can be expressed by the wavelet
(N )

most common neural network, SVM based on the structural equationψ


(N )
( x) = ∑ d (k )ϕ ( N ) (2 x − k ) , where scaling
risk minimization principle and linearly constrained k
quadratic programming theory can obtain better generation
performance [15,18,20]. To enhance the forecasting function is B-spline ϕ ( N ) ( x) given in (1), and
performance of stock returns farther, Cao, L., & Tay, F. E. coefficients d ( k ) are equal to [3]
H. introduced SVM into this field and proved that
(−1) k N
⎛ N ⎞ (2 N )
forecasting stock returns using SVM is not only feasible but d (k ) =
2 N −1
∑⎜l
l =0 ⎝
⎟ϕ (k − l + 1), k = 0,...,3 N − 2 (2)
also effective[2]. ⎠
The prediction performance of SVM is greatly dependent Theorem 3: Let ψ
(N )
( x) be a mother wavelet, let j and
upon the selection of kernel functions. There are many kinds
of existent support vector kernels such as the Gaussian and k denote the dilation and translation, respectively. All
polynomial kernels used to map the data in input space to a calculations are done on integer divisions, with the finest
high-dimensional feature space in which the problem
becomes linearly separable [17]. Since wavelet function can

978-0-7695-3645-3/09 $25.00 © 2009 IEEE 383


DOI 10.1109/CINC.2009.243
resolution level division { xk = k , k = 0,..., 2m } . If s, t ∈ R M , observations in the training set, 520 observations in the test
then dot-product wavelet kernels are: set. The optimal values of C , ε and γ are chosen based on
M J Lj −N cross validation. The same values of C and ε are used in
K ( s, t ) = ∏ ∑ ∑ψ (N )
j ,k
( si )ψ (j ,Nk )' (ti ), L j = 2m − j (3) the WSVM. The same method is also used in the WSVM to
i =1 j =1 k =1− N
choose the dilation j . All parameters are shown in Table 1.
Table 1 Values of parameter
Proof: Let x1 ,..., xl ∈ R M and a1 ,..., al ∈ R , Stock C epsilon gamma j
indices
l

∑ a a K (x
p ,q
p q
p
, xq ) DAXINDX
FRCAC40
1.3045
0.6621
0.0590
0.0996
2.5630
2.8314
-2
1
FTSE100 3.3870 0.0619 1.3236 1
l M J Lj −N
JAPDOWA 2.2175 0.0706 2.0258 -3
= ∑ a p aq ∏ ∑ ∑ψ (N )
j ,k
( xip )ψ (j ,Nk )' ( xiq ) SPCOMP 1.7604 0.0822 1.5958 2
p ,q i =1 j =1 k =1− N

⎛ l M J Lj −N ⎞⎛ l M J Lj − N ⎞ The prediction performance [16] is evaluated using


= ⎜⎜ ∑ a p ∏ ∑ ∑ ψ (j ,Nk ) ( xip ) ⎟⎜
⎟⎜ ∑ aq ∏ ∑ ∑ ψ (j ,Nk )' ( xiq ) ⎟⎟ normalized mean squared error (NMSE), root mean squared
⎝ p i =1 j =1 k =1− N ⎠⎝ q i =1 j =1 k =1− N ⎠ error (RMSE) and mean absolute error (MAE). They are the
2
⎛ l M J Lj −N ⎞ measures of the deviation between the actual and predicted
= ⎜⎜ ∑ a p ∏ ∑ ∑ ψ (j ,Nk ) ( xip ) ⎟⎟ values. The smaller the values of them, the closer are the
⎝ p i =1 j =1 k =1− N ⎠ predicted time series values to the actual values. It means
≥0 that a smaller value suggests a better predictor. The results
Hence, dot-product kernels satisfy Mercer’s condition. are collated and the best results are recorded as follow,
Therefore, it is admissible support vector kernel. which are gained from the fourth sets (December 1993-
December 1997).
III. EXPERIMENT ANALYSIS
The results on the test set in Table 2 provide a better basis
The real world data examined in the experiment are for a comparison of the two kernels where over-fitting
composed of the following daily indices: DAXINDX, issues may be neglected. It can be observed that in all other
FRCAC40, FTSE100, JAPDOWA and SPCOMP. All the daily indices (DAXINDX, FRCAC40, JAPDOWA and
index data encompass the period from January 1, 1992 to SPCOMP), the smaller values of NMSE and RMSE are in
December 31, 1997. There are 1560 observations for each spline wavelet kernel with the exclusion of FTSE100. As for
time series of stock index. MAE, Gaussian kernel is only better in FTSE100. And a
Because the distribution of transformed data will become paired-test on the NMSE of the test set also shows that
more symmetrical and closer to normal so as to improve the spline wavelet kernel outperforms Gaussian kernel with
predictive power [19], the original data is transformed into a 10% significance level for a one-tailed test.
five-day Relative Difference in Percentage (RDP) of the Table 2 Results on the testing set
closing price [2]. The input variables are determined from Stock Gaussian kernel Spline Wavelet kernel
four lagged RDP values based on five-day periods (RDP-5, indices NMSE RMSE MAE NMSE RMSE MAE
RDP-10, RDP-15, and RDP-20) and one transformed DAXINDX 1.7946 0.2979 0.2266 0.9637 0.2183 0.1581
FRCAC40 0.9645 0.2505 0.1948 0.8996 0.2420 0.1865
closing price (EMA15) which is obtained by subtracting a FTSE100 0.8466 0.1781 0.1404 0.9176 0.1854 0.1463
15-day exponential moving average from the closing price. JAPDOWA 0.9110 0.1875 0.1434 0.9063 0.1871 0.1428
EMA15 is used to maintain as much of the information SPCOMP 1.1605 0.3029 0.2434 0.8796 0.2899 0.2334
contained in the original closing price as possible since the t-value 1 .4 8 7 9 > t 0 .1 ,6 = 1 .4 3 9 8

RDP transform of the original closing price may lose some


useful information. The output variable RDP+5 is obtained The predicted and actual RDP+5 from both two kernels
by first smoothing the closing price with a three-day for the test sets are illustrated in Fig.1 and Fig.2, where only
exponential moving average, because the application of a the JAPDOWA is drawn, since it has well representative
smoothing transform to the dependent variable generally values of NMSE and NMAE in all daily indices. In this
enhances the prediction performance. investigation, the parameter C and ε are respectively
To avoid attributes in greater numeric ranges dominate chosen to be 2.2175 and 0.0706. The Gaussian kernel
those in smaller numeric ranges, all the data points are parameter γ is fixed at 2.0258. B-Spline wavelet with 3
scaled into the range of [−1,1] as the data points include degree is applied to SWSVM with the dilation j setting to -3.
both positive values and negative values. Each whole data It is clear that both Gaussian and spline wavelet kernel are
set is divided into several overlapping training and testing enough to grasp the features reflected by the time series. But
sets according to the walk-forward testing routine [9]. Each the predictions made by spline wavelet kernel are better than
training and test set is moved forward through the time Gaussian kernel according to Fig.1 and Fig.2. As we can see
series by 130 observations, in which there are a total of 520 in Table 2, performance values reinforce this evidence, too.

384
IV. CONCLUSION [3] C.K.,Chui. An Introduction to Wavelets. Elsevier,1992.
An effective spline wavelet kernel which we combine the [4] C.K.,Chui. Wavelets: A Mathematical Tool for Signal
spline wavelet theory with SVM to construct for stock index Analysis. SIAM, 1997.
[5] I. Daubechies. The wavelet transform, time-frequency
localization and signalanalysis. Information Theory,
IEEE Transactions on, 36(5):961–1005, 1990.
[6] I. Daubechies. Ten Lectures on Wavelets. Society for
Industrial & Applied Mathematics, 1992.
[7] G. Dorner. Neural Networks for Time Series Processing.
Neural Network World, 6(4):447–468, 1996.
[8] T. Hill, M. O’Connor, and W. Remus. Neural Network
Models for Time Series Forecasts. Management
Science, 42(7):1082–1092, 1996.
[9] I. Kaastra and M. Boyd. Designing a neural network for
forecasting financial and economic time series.
Neurocomputing, 10(3):215–236,1996.
Fig. 1. Actual RDP+5 values in blue and forecasted values in red by [10] MC Mackey and L. Glass. Oscillation and chaos in
Gaussian kernel on the test set.
physiological control systems. Science, 197(4300):287,
1977.
[11] SG Mallat. A theory for multiresolution signal
decomposition: the waveletrepresentation. Pattern
Analysis and Machine Intelligence, IEEE Transactions
on, 11(7):674–693, 1989.
[12] S. Mallat. A Wavelet Tour of Signal Processing.
Academic Press, 1999.
[13] L. Ma and K. Khorasani. New training strategies for
constructive neural networks with application to
regression problems. Neural Networks,17(4):589–609,
2004.
[14] D.C. Montgomery and G.C. Runger. Applied Statistics
Fig. 2. Actual RDP+5 values in blue and forecasted values in red by and Probability for Engineers. Hypothesis, 13(14):15,
spline wavelet kernel on the test set. 1914.
forecasting is presented in this letter. The existence of spline [15] K.R. Muller, A. Smola, G. Ratsch, B. Scholkopf, J.
wavelet kernel is proven firstly. And then the forecasting Kohlmorgen, and V. Vapnik. Predicting time series
performance of spline wavelet kernel is evaluated by using with support vector machines. Proceedings of the
five real daily indices. As demonstrated in the experiment, International Conference on Artificial Neural Networks,
though the prediction performance for FTSE100 is not
pages 999–1004, 1997.
satisfied, spline wavelet kernel forecasts significantly better
[16] J.C. Principe, N.R. Euliano, and W.C. Lefebvre. Neural
than Gaussian kernel in all aspects. The superior
performance of spline wavelet kernel to the Gaussian kernel and Adaptive Systems: Fundamentals through
mostly lies in that spline wavelet function is a set of bases Simulations with CD-ROM. John Wiley & Sons, Inc.
that can approximate arbitrary functions. Future work will New York, NY, USA, 1999.
involve a theoretic analysis of the multiscale frame. More [17] B. Scholkopf, C.J.C. Burges, A.J. Smola, et al.
sophisticated spline wavelet kernel which can capture Advances in Kernel Methods: Support Vector Learning,
nonlinear features of stock time series better will be explored 1999.
for further improving the performance of SWSVM in stock [18] A.J. Smola and B. Sch¨olkopf. A tutorial on support
index forecasting. vector regression. Statistics and Computing,
14(3):199–222, 2004.
[19] M. Thomason. The practitioner methods and tool.
REFERENCES Journal of Computational Intelligence in Finance,
7(3):36–45, 1999.
[1] GEP Box and GM Jenkins. (1970). Time series analysis; [20] V.N. Vapnik. The Nature of Statistical Learning
forecasting and control. Holden-Day, San Theory. Springer, 2000.
Francisco(CA). [21] SAM Yaser and AF. Atiya. Introduction to financial
[2] L. Cao and F.E.H. Tay. Financial Forecasting Using forecasting. Applied Intelligence 1996; 6: 205–213
Support Vector Machines. Neural Computing & [22] Y. Zavjalov, I. Kvasov & L. Miroshnicenko. Spline
Applications, 10(2):184–192, 2001. Function Methods. Nauka(in Russian), 1980.

385

You might also like