# Financial Time Series Forecasting Using Directed-Weighted Chunking SVMs

Authors: Yongming Cai; Lei Song; Tingwei Wang; Qing Chang
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

Support vector machines (SVMs) are a promising alternative to traditional regression estimation approaches. But, when dealing with massive-scale data set, there exist many problems, such as the long training time and excessive demand of memory space. So, the SVMs algorithm is not suitable to deal with financial time series data. In order to solve these problems, directed-weighted chunking SVMs algorithm is proposed. In this algorithm, the whole training data set is split into several chunks, and then the support vectors are obtained on each subset. Furthermore, the weighted support vector regressions are calculated to obtain the forecast model on the new working data set. Our directed-weighted chunking algorithm provides a new method of support vectors decomposing and combining according to the importance of chunks, which can improve the operation speed without reducing prediction accuracy. Finally, IBM stock daily close prices data are used to verify the validity of the proposed algorithm.


---

## Body

## 1. Introduction

Financial time series forecasting is an important aspect of financial decisions. Financial practitioners and academic researchers have proposed a lot of methods and techniques to improve the accuracy of predictions. Because it is inherently noisy, nonstationary, and deterministically chaotic [1], financial time series forecasting is regarded as one of the most challenging applications of modern time series forecasting.Time series analysis of the early years study is focused on the regression model, such as autoregression model like AR and ARMA and volatility model, like ARCH and GARCH. In recent years, studies focused on application of artificial intelligence algorithms (AI), such as artificial neural networks (ANN) [2–4], reasoning neural networks (RNN) [5], genetic algorithms (GA) [6], particle swarm optimization (PSO) [7, 8], and support vector machines (SVMs) [9, 10].Among these artificial intelligence algorithms, SVMs are an elegant tool for solving pattern recognition and regression problems. According to the research of Vapnik [11], SVMs implement the structural risk minimization principle which seeks to minimize an upper bound of the generalization error rather than minimize the training error. The regression model of SVMs, called support vector regression (SVR), has also been receiving increasing attention to solve linear or nonlinear estimation problems. For instance, Tay and Cao [9] studied the five real future contracts in Chicago Mercantile Market, Cao and Tay [12] studied the S&P 500 daily price index, and Kim [13] studied the daily Korea composite stock price index (KOSPI). Based on the criteria of normalized mean square error (NMSE), mean absolute error (MAE), directional symmetry (DS), and weighted directional symmetry (WDS), the above researches indicate that the performance of SVMs is better than ARMA, GARCH (ARCH), and ANN.According to the statistical learning theory (SLT), support vector machine regression is a convex quadratic programming (QP) optimization with linear constraint. However, there is an obvious disadvantage of SVMs that the training time scales somewhere between quadratic and cubic depend on the number of training samples. In order to deal with massive data set and improve the training speed, many improved support vector machine methods are proposed. One way is to combine SVMs with some other methods, such as active learning [14, 15], multitask learning [16, 17], multiview learning [18], and semisupervised learning [19, 20]. Another way is to develop some optimization techniques of training algorithms in SVMs, such as sequential updating methods, like kernel-Adatron algorithm [21], successive over relaxation algorithm [22], working set methods, like chunking SVMs [23, 24], reduced support vector machine (RSVM) [25], and sequential minimal optimization algorithm (SMO) [26].Chunking SVMs, reduced support vector machine (RSVM), and SVMs with sequential minimal optimization (SMO) are outstanding methods in dealing with massive data set. For example, Lee and Mangasarian [25] designed a reduced support vector machine algorithm (RSVM), which can greatly reduce the size of the quadratic program to be solved by reducing the data set volume, so the memory usage is much smaller than that of a conventional SVM using the entire data set. Osuna et al. [27] designed a decomposition algorithm that is guaranteed to solve the QP problem and that does not make assumptions on the expected number of support vectors. Platt [26] put forward a sequential minimal optimization algorithm (SMO), which breaks the large QP problem into a series of smallest possible QP problems which are analytically solvable in order to speed up the training time. Tay and Cao [28] proposed to combine support vector machines (SVMs) with self-organizing feature map (SOM) for financial time series forecasting, where SOM is used as a clustering algorithm to partition the whole input space into several disjoint regions. Tay and Cao [29] also put forwardC-ascending support vector machines to amend the ε-insensitive errors in the nonstationary financial time series.Most of the improved support vector machine methods do well in memory requirement and CPU time, but the forecast accuracy has declined more or less. For financial time series prediction, the typical massive-scale data, we should pay more attention to the prediction accuracy while reducing the computational complexity. In this paper, we proposed a directed-weighted chunking SVMs algorithm, which can improve the operation speed without reducing prediction accuracy.This paper consists of five sections. Section1 introduces the basic algorithm of SVM. Section 2 proposes a directed-weighted chunking SVMs algorithm. Section 3 designs a series of experiments, and empirical results are summarized and discussed. Section 4 presents the conclusions and limitations of this study.


## 2. SVMs Regression Theory

In this section, we will briefly introduce the support vectors regression (SVR) theory. Suppose there are a given set of data pointsG
=
{
(
x
i
,
d
i
)
}
i
l (x
i is the input vector; d
i is the desired value). SVMs approximate the function in the following form:
(1)
y
=
∑
i
=
1
l
w
i
ϕ
i
(
x
)
+
b
,
where {
ϕ
(
x
)
}
i
=
1
l are the features of inputs and {
w
i
}
i
=
1
l, b are coefficients.According to the structural risk minimization principle, the support vectors regression problem can be expressed as(2)
Minimize:
R
(
w
,
ξ
(
*
)
)
=
1
2
w
T
w
+
C
*
∑
i
=
1
l
(
ξ
i
+
ξ
i
*
)
,
Subject
to:
w
ϕ
(
x
i
)
+
b
-
d
i
≤
ε
+
ξ
i
,
d
i
-
w
ϕ
(
x
i
)
-
b
≤
ε
+
ξ
i
*
,
ξ
i
,
ξ
i
*
≥
0
,
i
=
1,2
,
…
,
l
,
where x
i is mapped to a higher dimensional space by the function ϕ. ξ
i and ξ
i
* are slack variables (
ξ
i is the upper training error; ξ
i
* is the lower), which are subject to the ε-insensitive tube |
d
i
-
(
w
ϕ
(
x
i
)
+
b
)
|
≤
ε. The parameters which control the regression quality are the cost of error C, the width of the tube ε, and the mapping function ϕ.Thus, (1) becomes the following explicit form:
(3)
f
(
x
,
a
i
,
a
i
*
)
=
∑
i
=
1
l
(
a
i
-
a
i
*
)
K
(
x
,
x
i
)
+
b
.Then, we can obtain the following form by maximizing the dual form of function (3):
(4)
ϕ
(
a
i
,
a
i
*
)
=
∑
i
=
1
l
d
i
(
a
i
-
a
i
*
)
-
ε
∑
i
=
1
l
(
a
i
+
a
i
*
)
-
1
2
∑
i
=
1
l
∑
j
=
1
l
(
a
i
-
a
i
*
)
(
a
i
-
a
i
*
)
K
(
x
i
,
x
j
)
,
with the following constraints:
(5)
∑
i
=
1
l
(
a
i
-
a
i
*
)
=
0
,
0
≤
a
i
≤
C
,
i
=
1,2
,
…
,
l
,
0
≤
a
i
*
≤
C
,
i
=
1,2
,
…
,
l
,
where the a
i, a
i
* are the Lagrange multipliers introduced and K
(
x
,
x
i
) is named the kernel function. The value is equal to the inner product of two vectors x
i and x
j in the feature spaces ϕ
(
x
i
) and ϕ
(
x
j
). There are many choices of the kernel function: common examples are the polynomial kernel K
(
x
i
,
x
j
)
=
(
x
i
x
j
+
1
)
d and Gaussian kernel K
(
x
i
,
x
j
)
=
exp
⁡
(
-
δ
2
(
x
i
-
x
j
)
2
).Training SVMs is equivalent to optimizing the Lagrange multipliersa
i, a
i
* with constraints based on (4). Good fitting function can be obtained by choosing appropriate functional space.There are many different researches using the straightforward approaches to construct and implement SVMs for financial time series analysis (see, e.g., [9, 13, 30]); other methods like chunking SVMs, reduced support vector machine (RSVM), and SVMs with sequential minimal optimization (SMO) are used to deal with massive-scale data sets. Among these methods, SVM chunking provides an alternative method to running a typical SVM on a data set by breaking up the training data and running the SVM on smaller chunks of data. In previous literature, many decomposition and combination methods are proposed.We would like to mention that, for financial time series prediction problems, the data set from different periods will have different effects on current forecasts, and the change of direction of past stock price will also affect the current forecasts. Therefore, we proposed directed-weighted chunking SVMs, which can improve the operation speed without reducing prediction accuracy.


## 3. The Directed-Weighted Chunking SVMs

### 3.1. Chunking Model in Support Vector Regression

Training SVMs is equivalent to solving a linearly constrained QP problem. Training SVMs depends on QP optimization techniques. Standard QP techniques cannot be directly applied to SVMs problems with massive-scale data set. In training stages of directed-weighted chunking SVMs, the whole training set is decomposed into several chunks, and support vectors are calculated, respectively, in their working subset. In the prediction stage, all these support vectors are combined into new working data set to get the model in accordance with their importance as illustrated in Figure1, and the progress of directed-weighted chunking SVMs algorithm can be described as follows.Figure 1
Model of directed-weighted chunking SVMs.Step 1.
Decompose the whole training setG into m subsets G
1
,
G
2
,
…
,
G
m, and G
=
G
1
∪
G
2
,
∪
⋯
,
∪
G
m, G
i
∩
G
j
=
Φ.Step 2.
Calculate the support vector regressionSV
G
i for each subset G
i.Step 3.
Calculate the weight and direction of each subset.Step 4.
Combine all support vectorsG
SVM
i for each subset into new working data set G
SVM.Step 5.
Calculate the weighted support vector regression on the new working data setG
SVM, and get the model.


### 3.2. Directed-Weighted Chunking SVMs

In the time series forecasting, such as stock market, the effect of past stock prices on the future stock prices will be different. Usually, the more recent the period of time, the greater the weight coefficient. According to a certain time interval, the total time series of stock prices will be divided into different chunks, and support vectors in each chunk are calculated, respectively. Furthermore, the weighted support vector regressions are calculated to obtain the forecast model.The stock market is one of the complex systems [31, 32]. We can treat chunks as the nodes and relationship between chunks as edges. Thus, these nodes and edges will be a complex network. The entire time series of stock price can be regarded as a directed-weighted network with a large number of nodes and edges. The mutual influence between chunks has its direction. For example, in chunks G1 and G2, if there exists a nonzero correlation coefficient from chunk G1 to G2, we will draw a directed edge between G1 and G2. Because the strength of mutual influence between chunks is different, the edge weight, which is called correlation intensity, is also different. So, simply chunking SVMs cannot reflect the influence of respective chunk on final model. Here we will introduce directed-weighted chunking algorithm into SVMs.In traditional SVM regression optimization problem, the parameterC
* is a constant. In order to show the different influence on the prediction results, we introduce a function Q
(
) and modify the SVMs regression function as follows:
(6)
R
(
w
,
ξ
(
*
)
)
=
1
2
w
T
w
+
C
*
∑
i
=
1
l
Q
(
G
i
,
Δ
t
)
(
ξ
i
+
ξ
i
*
)
.In (6), Q
(
G
i
,
Δ
t
) can be understood as the weight of each chunk, and the values of Q
(
G
i
,
Δ
t
) can be positive or negative. The positive or negative values of Q
(
G
i
,
Δ
t
) will change parameter C
* in SVMs, which is very similar to that of the positive or negative information impact on the future stock price. According to the definition of network correlation coefficient introduced by Bonanno et al. [33], we can define the correlation intensity Q
(
G
i
,
Δ
t
) (influence of chunk G
i by the time interval Δ
t) as follows:(7)
Q
(
G
i
,
Δ
t
)
=
〈
R
(
G
i
,
t
)
R
(
G
i
,
t
-
Δ
t
)
〉
-
〈
R
(
G
i
,
t
)
〉
〈
R
(
G
i
,
t
-
Δ
t
)
〉
〈
[
R
(
G
i
,
t
)
-
〈
R
(
G
i
,
t
)
〉
]
2
〉
〈
[
R
(
G
i
,
t
-
Δ
t
)
-
〈
R
(
G
i
,
t
-
Δ
t
)
〉
2
]
〉
,where 〈
〉 is a temporal average always performed over the investigated time period; t represents a time; Δ
t represents a time interval; R
(
G
i
,
t
) is the stock returns in a time interval Δ
t, and R
(
G
i
,
t
)
=
ln
⁡
[
p
(
G
i
,
t
)
]
-
ln
⁡
[
p
(
G
i
,
t
-
Δ
t
)
] is the logarithmic difference of current stock price and the stock price before the time interval Δ
t.According to the data point and time intervalΔ
t, original data can be decomposed into several chunks. The boundary of Q
(
G
i
,
Δ
t
) is -
1
≤
Q
(
G
i
,
Δ
t
)
≤
1. If the Q
(
G
i
,
Δ
t
) is positive, the influence of chunk G
i on the time interval Δ
t is positive, and vice versa. We can calculate all the correlation intensity Q
(
G
i
,
Δ
t
) according to (7) and get a m
×
m matrix of correlation intensity. Using these correlation intensity values, we can get a relationship matrix with direction and weight. Now, dual form of the original optimization problem can be deduced as
(8)
max
⁡
{
-
1
2
∑
i
=
1
l
∑
j
=
1
l
(
a
i
-
a
i
*
)
(
a
i
-
a
i
*
)
K
(
x
i
,
x
j
)
+
∑
i
=
1
l
a
i
(
d
i
-
ε
)
-
a
i
*
(
d
i
+
ε
)
}
,
Subject
to
:
∑
i
=
1
l
(
a
i
-
a
i
*
)
=
0
,
0
≤
a
i
≤
C
Q
(
G
i
,
Δ
t
)
,
i
=
1,2
,
…
,
l
,
0
≤
a
i
*
≤
C
Q
(
G
i
,
Δ
t
)
,
i
=
1,2
,
…
,
l
.Now, the solution of this equation is the overall optimal solution of the original optimization problem.


## 3.1. Chunking Model in Support Vector Regression

Training SVMs is equivalent to solving a linearly constrained QP problem. Training SVMs depends on QP optimization techniques. Standard QP techniques cannot be directly applied to SVMs problems with massive-scale data set. In training stages of directed-weighted chunking SVMs, the whole training set is decomposed into several chunks, and support vectors are calculated, respectively, in their working subset. In the prediction stage, all these support vectors are combined into new working data set to get the model in accordance with their importance as illustrated in Figure1, and the progress of directed-weighted chunking SVMs algorithm can be described as follows.Figure 1
Model of directed-weighted chunking SVMs.Step 1.
Decompose the whole training setG into m subsets G
1
,
G
2
,
…
,
G
m, and G
=
G
1
∪
G
2
,
∪
⋯
,
∪
G
m, G
i
∩
G
j
=
Φ.Step 2.
Calculate the support vector regressionSV
G
i for each subset G
i.Step 3.
Calculate the weight and direction of each subset.Step 4.
Combine all support vectorsG
SVM
i for each subset into new working data set G
SVM.Step 5.
Calculate the weighted support vector regression on the new working data setG
SVM, and get the model.


## 3.2. Directed-Weighted Chunking SVMs

In the time series forecasting, such as stock market, the effect of past stock prices on the future stock prices will be different. Usually, the more recent the period of time, the greater the weight coefficient. According to a certain time interval, the total time series of stock prices will be divided into different chunks, and support vectors in each chunk are calculated, respectively. Furthermore, the weighted support vector regressions are calculated to obtain the forecast model.The stock market is one of the complex systems [31, 32]. We can treat chunks as the nodes and relationship between chunks as edges. Thus, these nodes and edges will be a complex network. The entire time series of stock price can be regarded as a directed-weighted network with a large number of nodes and edges. The mutual influence between chunks has its direction. For example, in chunks G1 and G2, if there exists a nonzero correlation coefficient from chunk G1 to G2, we will draw a directed edge between G1 and G2. Because the strength of mutual influence between chunks is different, the edge weight, which is called correlation intensity, is also different. So, simply chunking SVMs cannot reflect the influence of respective chunk on final model. Here we will introduce directed-weighted chunking algorithm into SVMs.In traditional SVM regression optimization problem, the parameterC
* is a constant. In order to show the different influence on the prediction results, we introduce a function Q
(
) and modify the SVMs regression function as follows:
(6)
R
(
w
,
ξ
(
*
)
)
=
1
2
w
T
w
+
C
*
∑
i
=
1
l
Q
(
G
i
,
Δ
t
)
(
ξ
i
+
ξ
i
*
)
.In (6), Q
(
G
i
,
Δ
t
) can be understood as the weight of each chunk, and the values of Q
(
G
i
,
Δ
t
) can be positive or negative. The positive or negative values of Q
(
G
i
,
Δ
t
) will change parameter C
* in SVMs, which is very similar to that of the positive or negative information impact on the future stock price. According to the definition of network correlation coefficient introduced by Bonanno et al. [33], we can define the correlation intensity Q
(
G
i
,
Δ
t
) (influence of chunk G
i by the time interval Δ
t) as follows:(7)
Q
(
G
i
,
Δ
t
)
=
〈
R
(
G
i
,
t
)
R
(
G
i
,
t
-
Δ
t
)
〉
-
〈
R
(
G
i
,
t
)
〉
〈
R
(
G
i
,
t
-
Δ
t
)
〉
〈
[
R
(
G
i
,
t
)
-
〈
R
(
G
i
,
t
)
〉
]
2
〉
〈
[
R
(
G
i
,
t
-
Δ
t
)
-
〈
R
(
G
i
,
t
-
Δ
t
)
〉
2
]
〉
,where 〈
〉 is a temporal average always performed over the investigated time period; t represents a time; Δ
t represents a time interval; R
(
G
i
,
t
) is the stock returns in a time interval Δ
t, and R
(
G
i
,
t
)
=
ln
⁡
[
p
(
G
i
,
t
)
]
-
ln
⁡
[
p
(
G
i
,
t
-
Δ
t
)
] is the logarithmic difference of current stock price and the stock price before the time interval Δ
t.According to the data point and time intervalΔ
t, original data can be decomposed into several chunks. The boundary of Q
(
G
i
,
Δ
t
) is -
1
≤
Q
(
G
i
,
Δ
t
)
≤
1. If the Q
(
G
i
,
Δ
t
) is positive, the influence of chunk G
i on the time interval Δ
t is positive, and vice versa. We can calculate all the correlation intensity Q
(
G
i
,
Δ
t
) according to (7) and get a m
×
m matrix of correlation intensity. Using these correlation intensity values, we can get a relationship matrix with direction and weight. Now, dual form of the original optimization problem can be deduced as
(8)
max
⁡
{
-
1
2
∑
i
=
1
l
∑
j
=
1
l
(
a
i
-
a
i
*
)
(
a
i
-
a
i
*
)
K
(
x
i
,
x
j
)
+
∑
i
=
1
l
a
i
(
d
i
-
ε
)
-
a
i
*
(
d
i
+
ε
)
}
,
Subject
to
:
∑
i
=
1
l
(
a
i
-
a
i
*
)
=
0
,
0
≤
a
i
≤
C
Q
(
G
i
,
Δ
t
)
,
i
=
1,2
,
…
,
l
,
0
≤
a
i
*
≤
C
Q
(
G
i
,
Δ
t
)
,
i
=
1,2
,
…
,
l
.Now, the solution of this equation is the overall optimal solution of the original optimization problem.


## 4. Experiments

In order to make a fair and thorough comparative between directed-weighted chunking SVMs and ordinary SVMs, the IBM stock daily close prices are selected as shown in Figure2. The data points cover the time period from December 31, 1999, up to December 31, 2013, which has 21132 data points.Figure 2
The IBM stock daily close prices (from December 31, 1999, up to December 31, 2013). Source: Yahoo Finance,http://finance.yahoo.com/.Data points starting from December 31, 1999, up to December 31, 2007 (12075 data points), are used for training, and data points starting from January 1, 2008, up to the December 31, 2013 (9057 data points), are used for testing. Now we decomposed the training data into 1208 chunks by the time intervals of 10 days and calculated the correlation intensityQ
(
G
i
,
Δ
t
) according to the function (7). Finally, we obtain a 1208
×
1208 matrix of correlation intensity.


### 4.1. Forecast Accuracy Assessment of Directed-Weighted Chunk SVMs

The prediction performance is evaluated by using the following statistical metrics, namely, the normalized mean squared error (NMSE), the mean absolute error (MAE), and the directional symmetry (DS). These criteria are calculated as (9). NMSE and MAE are the measures of the deviation between the actual and predicted values. The values of NMSE and MAE denote the accuracy of prediction. A detailed description of performance metrics in financial forecasting can be referred to in Abecasis [34]:
(9)
NMSE
=
1
σ
2
N
∑
i
=
1
N
(
y
i
-
y
i
^
)
2
,
where
,
σ
2
=
1
N
-
1
∑
i
=
1
N
(
y
i
-
y
-
i
)
2
,
y
-
i
=
1
N
∑
i
=
1
N
y
i
,
MAE
=
1
N
∑
i
=
1
N
|
y
i
-
y
i
^
|
,
DS
=
100
N
∑
i
=
1
N
d
i
,
where
d
i
=
{
1
(
y
i
-
y
i
-
1
)
(
y
i
^
-
y
^
i
-
1
)
0
otherwise
.The program of directed-weighted chunking SVMs algorithm is developed using R language. In this paper, the Gaussian function is used as the kernel function of the SVMs. The experiments show that a width value of the Gaussian function of 0.02 is found to produce the best possible results.C and ε are arbitrarily chosen to be 8.5 and 10−3, respectively.We calculate the SVMs on the training data sets (from December 31, 1999, up to December 31, 2007) and then obtain the trained model. Finally, we obtain the predicted result by applying the trained model on the test data set (from January 1, 2008, up to December 31, 2013). In order to compare the differences of various algorithms, real value, predicted value in ordinary SVMs, and the predicted value in directed-weighted chunking SVMs are plotted in Figure3.Figure 3
The predicted value of IBM stock daily close prices in test data set (from January 01, 2008, up to December 31, 2013).In Figure3, we can clearly see that these two forecasting methods are very precise, but it is hard to tell which one is more excellent. So we calculated the performance criteria, respectively, as shown in Table 1. By comparing these data, we find that the NMSE, MAE, and DS of directed-weighted chunking SVMs are 0.3760, 0.1325, and 38.29 on the training set and 1.0121, 0.2846, and 43.78 on the test set. It is evident that these values are much smaller than those of ordinary SVMs, which indicates that there is a smaller deviation between the actual values and predicted values with directed-weighted chunking SVMs.Table 1
Results of accuracy performance criteria.
D-W chunking SVMs
Ordinary SVMs
NMSE
MAE
DS
NMSE
MAE
DS
Training set
0.3760
0.1325
38.29
0.5625
0.1778
41.67
Test set
1.0121
0.2846
43.78
1.3574
0.2564
48.97


### 4.2. Calculation Performance of Directed-Weighted Chunk SVMs

As is well known, the performance of SVM depends on the parameters. But, it is difficult to choose suitable parameters for different problems. Chunk algorithm reused the Hessian matrix elements from one to the next, which can improve the performance sharply.The calculation performance of all algorithms is measured on an unloaded AMD E-350 1.6 GHz processor running Windows 7 and R 3.0.1. The same experiment will be done on the data set of IBM stock daily close prices. The results of the experiments are shown in Table2.Table 2
Performance comparison between the traditional SVMs and directed-weighted chunk SVMs.
SVM method
Sensitivity
Specificity
CPU time (ms)
Traditional SVMs
0.79
0.81
458231
Directed-weighted chunk SVMs.
0.83
0.85
65367
Dataset: IBM stock daily close prices in training data set (12075 data points, from December 31, 1999, up to December 31, 2007).
SVMs parameters: kernel is Gaussian function withσ
=
0.02, C
=
8.5, ε
=
0.001, and tolerance = 0.001.
Chunking methods: now we decomposed the training data into 1208 chunks by the time intervals of 10 days.
The CPU time covered the execution of entire algorithm excluding  the file I/O time.The primary purpose of these experiments is to examine differences of training times between two methods. An overall comparison of the SVM methods can be found in Table2. Compared to the traditional SVMs, directed-weighted chunk SVMs can improve the accuracy and decrease run times sharply. Additionally, the directed-weighted chunk SVMs method allows users to add machines to make the algorithm training even faster.


### 4.3. Analysis of Optimal Number of Chunks in Directed-Weighted Chunk SVMs

In the experiment described above, we decomposed the training data into 1208 chunks by the time intervals of 10 days arbitrarily and got a satisfactory prediction. Original training data set can be decomposed into 500 chunks or 5000 chunks also. Doing the same experiments on the same training sets by different chunks, we will get a series of performance data. Plotting the curve based on chunks number and NMSE values (in Figure4), we can intuitively discover relationships between chunks number and errors and get the optimal number of chunks.Figure 4
NMSE value in different chunks (IBM stock daily close prices data).According to NMSE criteria, we get the minimum NMSE value 0.3173 on the point of chunks 2350. That means that the best number of chunks is 2350. Under this chunking number, we can get the best performance of prediction.From Figure4, when the chunks number is increased, NMSE value is declined rapidly. But, when the decrease reaches a certain value, NMSE value will increase conversely. However, this upward trend is not very large, which indicates that the directed-weighted chunking SVM is not a fundamental transform of SVM, but a limited improvement. But from the perspective of processing massive-scale data, this improvement is very important.


## 4.1. Forecast Accuracy Assessment of Directed-Weighted Chunk SVMs

The prediction performance is evaluated by using the following statistical metrics, namely, the normalized mean squared error (NMSE), the mean absolute error (MAE), and the directional symmetry (DS). These criteria are calculated as (9). NMSE and MAE are the measures of the deviation between the actual and predicted values. The values of NMSE and MAE denote the accuracy of prediction. A detailed description of performance metrics in financial forecasting can be referred to in Abecasis [34]:
(9)
NMSE
=
1
σ
2
N
∑
i
=
1
N
(
y
i
-
y
i
^
)
2
,
where
,
σ
2
=
1
N
-
1
∑
i
=
1
N
(
y
i
-
y
-
i
)
2
,
y
-
i
=
1
N
∑
i
=
1
N
y
i
,
MAE
=
1
N
∑
i
=
1
N
|
y
i
-
y
i
^
|
,
DS
=
100
N
∑
i
=
1
N
d
i
,
where
d
i
=
{
1
(
y
i
-
y
i
-
1
)
(
y
i
^
-
y
^
i
-
1
)
0
otherwise
.The program of directed-weighted chunking SVMs algorithm is developed using R language. In this paper, the Gaussian function is used as the kernel function of the SVMs. The experiments show that a width value of the Gaussian function of 0.02 is found to produce the best possible results.C and ε are arbitrarily chosen to be 8.5 and 10−3, respectively.We calculate the SVMs on the training data sets (from December 31, 1999, up to December 31, 2007) and then obtain the trained model. Finally, we obtain the predicted result by applying the trained model on the test data set (from January 1, 2008, up to December 31, 2013). In order to compare the differences of various algorithms, real value, predicted value in ordinary SVMs, and the predicted value in directed-weighted chunking SVMs are plotted in Figure3.Figure 3
The predicted value of IBM stock daily close prices in test data set (from January 01, 2008, up to December 31, 2013).In Figure3, we can clearly see that these two forecasting methods are very precise, but it is hard to tell which one is more excellent. So we calculated the performance criteria, respectively, as shown in Table 1. By comparing these data, we find that the NMSE, MAE, and DS of directed-weighted chunking SVMs are 0.3760, 0.1325, and 38.29 on the training set and 1.0121, 0.2846, and 43.78 on the test set. It is evident that these values are much smaller than those of ordinary SVMs, which indicates that there is a smaller deviation between the actual values and predicted values with directed-weighted chunking SVMs.Table 1
Results of accuracy performance criteria.
D-W chunking SVMs
Ordinary SVMs
NMSE
MAE
DS
NMSE
MAE
DS
Training set
0.3760
0.1325
38.29
0.5625
0.1778
41.67
Test set
1.0121
0.2846
43.78
1.3574
0.2564
48.97


## 4.2. Calculation Performance of Directed-Weighted Chunk SVMs

As is well known, the performance of SVM depends on the parameters. But, it is difficult to choose suitable parameters for different problems. Chunk algorithm reused the Hessian matrix elements from one to the next, which can improve the performance sharply.The calculation performance of all algorithms is measured on an unloaded AMD E-350 1.6 GHz processor running Windows 7 and R 3.0.1. The same experiment will be done on the data set of IBM stock daily close prices. The results of the experiments are shown in Table2.Table 2
Performance comparison between the traditional SVMs and directed-weighted chunk SVMs.
SVM method
Sensitivity
Specificity
CPU time (ms)
Traditional SVMs
0.79
0.81
458231
Directed-weighted chunk SVMs.
0.83
0.85
65367
Dataset: IBM stock daily close prices in training data set (12075 data points, from December 31, 1999, up to December 31, 2007).
SVMs parameters: kernel is Gaussian function withσ
=
0.02, C
=
8.5, ε
=
0.001, and tolerance = 0.001.
Chunking methods: now we decomposed the training data into 1208 chunks by the time intervals of 10 days.
The CPU time covered the execution of entire algorithm excluding  the file I/O time.The primary purpose of these experiments is to examine differences of training times between two methods. An overall comparison of the SVM methods can be found in Table2. Compared to the traditional SVMs, directed-weighted chunk SVMs can improve the accuracy and decrease run times sharply. Additionally, the directed-weighted chunk SVMs method allows users to add machines to make the algorithm training even faster.


## 4.3. Analysis of Optimal Number of Chunks in Directed-Weighted Chunk SVMs

In the experiment described above, we decomposed the training data into 1208 chunks by the time intervals of 10 days arbitrarily and got a satisfactory prediction. Original training data set can be decomposed into 500 chunks or 5000 chunks also. Doing the same experiments on the same training sets by different chunks, we will get a series of performance data. Plotting the curve based on chunks number and NMSE values (in Figure4), we can intuitively discover relationships between chunks number and errors and get the optimal number of chunks.Figure 4
NMSE value in different chunks (IBM stock daily close prices data).According to NMSE criteria, we get the minimum NMSE value 0.3173 on the point of chunks 2350. That means that the best number of chunks is 2350. Under this chunking number, we can get the best performance of prediction.From Figure4, when the chunks number is increased, NMSE value is declined rapidly. But, when the decrease reaches a certain value, NMSE value will increase conversely. However, this upward trend is not very large, which indicates that the directed-weighted chunking SVM is not a fundamental transform of SVM, but a limited improvement. But from the perspective of processing massive-scale data, this improvement is very important.


## 5. Conclusions

In this paper, we proposed a new chunks algorithm in SVMs regression, which combined the support vectors according to their importance. The proposed algorithm can improve the computational speed without reducing prediction accuracy.In our directed-weighted chunking SVMs,Δ
t, the criteria for the chunking, is a constant, but, in practice, Δ
t can be variable or some form of function. In addition, further studies on the different kernel functions and more suitable parameters ε and C can be done in order to improve the performance of directed-weighted chunking SVMs.



---

*Source: 170424-2014-04-24.xml*