• 沒有找到結果。

Chapter 2 Methodology

2.3 Artificial Neural Networks (ANNs)

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

19

2.3. Artificial Neural Networks (ANNs)

Artificial Neural Networks (ANNs) is an Artificial Intelligence Machine using mathematical method. And via computer ‘s rapid calculating ability, it makes computer have ability of predicting. It can simulate non- linear function. After several times of simulations, ANN becomes a complex functional form. Therefore, it is suitable for solving complex questions of non- linear system. Besides, one doesn‘t have to presupposition before using ANN. You can start analyzing just preparing enough history data. For instance, if one knows the factor of Fundamental information or Technical Information, he can use ANN to start stock index prediction. After many experiments proves, ANN can be applied on many field which old computer system cannot reaches, just as Face Recognition (Rowley et al., 1998)、Financial forecasting (Gately, E., 1996)…etc. In addition, ANN has potential ability of predicting time scale models and Nonparametric estimated as well (Kuan and White, 1994).

This section gives an introduction to basic neural network architectures and learning rules. An ANN‘s all Neurons are layered by their functions. Three layers in general: input layer, hidden layer, and output layer. Each layer is linked by foregoing order.

1. Input layer: use to represent input variable data. Neurons‘ number are depends on question. In this study, we use IMF decomposed by EEMD as input data.

2. Hidden layer: use to represent the inter-effects between input data. In many research results and engineering simulation all shows hidden layer doesn‘t need above two layers (Hush and Horne, 1993) , pointed out network which use two layers in hidden layer, each layer only has a few neurons. It can be replaced by a network with a great amount of neurons in a layer. Moreover, the amount of neurons has to use trail route to decide its best number. ANN

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

20

cannot depict the system properly with too little number of neurons. Too large number of neurons will provide over- fitting problem (I. Kaastra, M.

Boyd, 1996).

3. Output layer: use to represent output data. In this study, we predict TAIEX futures price. Therefore, the neuron‘s number is 1 in output layer.

The basic principle of ANN is using weight to connect each layer‘s neurons. If there are two neurons is stimulated at once by a connection, the strength of this connection will increase. If the two neurons in a connection is not stimulated simultaneously, e.g. one has response, the other doesn‘t, then the strength of this connection will weaken or vanish (Stent et al., 1973). Each input data will reach hidden layer after weighted accumulation. Through Transfer function there will be a value. The processing flow is represented in Figure2.2.

Figure 2.2 Three-Layer Neural Networks

Transfer functions are mathematical formulas that determine the output of proces sing neurons. The selection of transfer function will affect the whole network‘s trait. Therefore, networks having different characteristic have to select different transfer functions. Three kinds of transfer functions which are usually used in Back-Propagation Neural Network in this paper is: hyperbolic function, log-sigmoid function and linear function.

( )

Since financial markets are nonlinear, nonlinear transfer functions are more favored.

So far, In ANN applying, the most popular one is Back-Propagation Neural Network (Rumelhart et al., 1986). It adopts the Widrow-Hoff learning rule (i.e. least mean

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

22

Figure 2.3 the Structure Chart of BPNN‘s Training Progress

The neurons here have two kinds of inputs, which are input value ―I‖ and bias value

―b‖. ‖I‖ is the real input data. In this study, our input values are IMFs after EEMD decomposition. They have to multiply the weights which connect hidden layer. ―b‖ is value which directly input in neurons. It is used to apply non-leaner Threshold Value.

Therefore, the formula of ANN dynamical system which has M layers can be expressed as: for 1≤i≤ Nm, 1≤j≤ Nm, 1≤m ≤M

 

1

1

N m m m

m m

i ij j i i

j

f

w b

f

n

Y Y

 

   

Each ANN contains Nm neuron and the iteration calculation is able to reflect one layer of the process unit in the network. For instance, the neuron i on the layer m accepts all the processed and weighted inputs from (m-1) layer and then adds external

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

23

input of 𝑖 to produce 𝑖 . 𝑌𝑖 can therefore be obtained after a non-linear transfer function and finally, the value of (𝑀) is the output of this network.

The network shown under had j inputs, i neurons in the first hidden layer, k neurons in the second hidden layer, one neuron in the output layer. Transfer function we choose Hyperbolic Function, Sigmoid Function and Purlin Function.

Figure 2.4 A Fully Connected with Four-Layer Feed-forward Network

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

24

2.3 EEMD-Based Neural Network Learning paradigms

Artificial neural networks have now been applied on multiple territories and show great forecasting results. One of the most important things is to improve the accuracy rate of ANN forecasting. The traditional artificial neural networks use Cross-validation. However, the result of the neural network learning by single series may be enough. Many researchers have done a lot of extensive research, such as Wavelet-based ANN (Martin F.et al., 2003), Fuzzy BP (Nayak, P.C. et al., 2004), and EMD-based ANN (Lean Yu et al., 2008). EEMD adopted in the study decomposes and screens the primary information of the stock price to several IMFs. Such method can stabilize the data, screen out noisy data, and leave the representative IMFs so that we could regard these IMFs as the input variables of ANN. In general, the EEMD-based neural network learning paradigm contains following steps:

(1) Adding different ε to the original time series data

(2) The input data set and target data set are extracted from the decomposed IMFs and original data.

(3) Put IMFs and residual as the input variables into ANN.

(4) Dividing the database into two sets: the training set and the testing and validation set.

(5) Creating an ANN structure with two hidden layers.

(6) The input data and target data will be co

(7) The number of iteration has infinite epochs.

(8) Reverse the processing of result to get predicts.

multi- functional random forecasting model, ARMA model are combined with two models.

1. Autoregressive model (AR):

In AR (P), the current observation value is produced by the weighted average of past observation values and current random error as the formula below:

𝑋𝑡 = c + 𝜀𝑡 + ∑ 𝜑𝑖𝑋𝑡−𝑖

𝑝

𝑖=1

2. Moving-average model (MA):

In MA (q), the observation value Yt is the weighted average of random errors in the past q periods.

𝑋𝑡 = μ + 𝜀𝑡 + ∑ 𝜃𝑖𝜖𝑡−𝑖

𝑞

𝑖=1

3. Autoregressive–moving-average model ARMA (p,q) :

Stationary random process has both the qualities of moving average and autogression.

Therefore both models should be used.

In this study, ARMA model is used to forecast TAXIE and establish trading strategy.

The accuracy rate and forecasting efficacy of ARMA model is also compared with the results produced by EEMD-ANN models.

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

26

Chapter 3 Experimental Details

3.1 Data description Index Futures

Index futures, as one of the various commodity futures, can be categorized as product and finance in accordance with the nature of contracts in the international market. The sub-category of product includes: agricultural products, metals, energies and so forth while finance includes interest rate, exchange rate, and stock market index. One of the most known items above is the stock market index such as Japanese Nikkei 225, American S&P 500, Dow Jones Industrial Average Index, and TAIEX Index. The stock market index is generated from the weighted average or mean value of a holding of stock. For instance, the TAIEX Index is the weighted average while Japanese Nikkei 225 is general from mean value. The stock index spot should be considered while trading the index futures since they are actually the spot in the future.

If not, the arbitrage trade cannot be succeeded.

The main functions of index futures are hedging, arbitrage, and speculation. As for most investors, the purpose of stock trading is hedging (back spread) and one of the most crucial advantages of index futures is the financial leverage. Stock trading requires the screening capability to avoid earning points but losing top spot. The trading of index futures can simplify the target so that investor only needs to understand the trend of market to make a good trade. The traders of TAIEX futures must refer to the stock index spot provided by the information system otherwise the future market maybe disorientated. Therefore, as for the TAIEX Index, there will be two different index prices in the market – the index spot and the index futures.

It can be told that TAIEX Futures have become one of the significant investing targets for legal entities or individual investors from the growth of trading volume.

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

27

Statistics from Taiwan Future Exchange show that legal entities have grown greatly in the recent years which suggest that the understandings of futures and options have been furthered hence more and more investors attempt to trade futures and options for hedging and arbitrage which cause the steady increase of trading volumes.

Table 3.1 the Trading Volumes from 2000 to 2005

Year 2000 2001 2002 2003 2004 2005

Volume 1,339,907 2,844,709 4,132,040 6,514,691 8,861,278 6,917,375

Table 3.2 the Trading Volumes from 2006 to 2011

Year 2006 2007 2008 2009 2010 2011

Volume 9,914,999 11,813,150 19,819,775 24,625,062 25,332,827 30,611,932

Figure 3.1 the Booming Figure of Trading Volumes during 2000 ~2011 0.0

0.5 1.0 1.5 2.0 2.5 3.0 3.5

2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011

x 107

Time (Year)

Volume

Underlying Index Taiwan Stock Exchange Capitalization Weighted Stock Index (TAIEX) Ticker Symbol TX

Delivery Months Spot month, the next calendar month, and the next three quarterly months Last Trading Day The third Wednesday of the delivery month of each contract

Trading Hours

1. 08:45AM-1:45PM Taiwan time Monday through Friday of the regular business days of the Taiwan Stock Exchange

2. 08:45AM-1:30PM on the last trading day for the delivery month contract Contract Size NTD 200 x per index point

Minimum Price

Fluctuation One index point (NTD 200)

Daily Price Limit +/- 7% of previous day's settlement price based on the clearing margin calculated according to TAIFEX‘s Criteria and Collecting Methods Regarding Clearing Margins, plus a percentage

prescribed by TAIFEX.

Daily Settlement Price

The daily settlement price is the volume weighted average price, which is calculated by dividing the value of trades by the volume within the last one minute, or as otherwise determined by TAIFEX according to the Trading Rules. calculate final settlement price.

Settlement Cash settlement

Position Limit

Combined with the calculation of MTX position limit (on a pro rata basis of 1:4 contract size)

These position limits are not applicable to omnibus accounts.

Source: Taiwan Future Exchange

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

29

The data attempted to forecast in the study were the historical data of daily TAIEX futures closing price. The data collection was made from 2010/1/4 to 2010/12/31, total of 250 business days. The Figure 3.2 of data collection is as follow:

Figure 3.2 the TAIEX Futures during 2010

3.2 The Operation of Price

The reason why the market mechanism is so charming is that we always believe as long as we know the price fluctuation patterns, no loss will be made. Yet, it is not and the uncertainty of market is even higher than the fluctuation of price, which include:

1. The uncertainty of price fluctuation

Will the stock price go up or down tomorrow? Three models were used to forecast the direction of stock price of the next day in this study.

2. The uncertainty of the fluctuation range

Assume the forecasted direction is correct, we may profit only a bit before our position ends or we may profit greatly yet the comeback of price in the end causes the profit. Both cases are caused by the uncertainty of fluctuation range.

7000 7500 8000 8500 9000 9500

2010/1/4 2010/4/16 2010/7/27 2010/11/6

Time (Day)

Price

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

30

3. The uncertainty of the fluctuation pattern

Will the price go up and then down? When will the market callback? Will the price go directly or zigzag up? Will the callback be slow or acute? The answers to these questions remain uncertain and investors can only use trading strategy to protect their positions.

4. The uncertainty of unexpected event

Random interference, occasional events, and unexpected events are commonly occur in the market and may cause violent fluctuation at the moment. Investors must adopt trading strategies to avoid severe loss by preventing the impacts from violent fluctuation on their positions.

These uncertainties are complicate and changeful combinations therefore it is truly difficult to forecast the market. Especially, the financial operation difficulty has increased since the snowball impacts of subprime mortgage crisis in the U.S. reached on Europe and Asia after the bankruptcy of Lehman Brothers Holding Inc. as well as the global financial crisis initiated by the financial fail of Iceland government. The market ardently demands a relatively accurate forecasting system to prevent grand loss. The study compared the forecasting accuracies of three models and established the trading strategies in accordance with price forecasted in order to provide a decent forecasting model for the market.

measures used to analyze IMFs are mean periods, Pearson correlation coefficient, and power percentage. These measures are presented as follows:

Mean period

The mean period which is used to see the cycle of an IMF is calculated by the inverse of mean frequency. The mean frequency is the average of ―instantaneous frequency. To calculate the instantaneous frequency, we apply HHT to the extracted IMFs. In the following paragraph we will briefly introduce the HHT, proposed by Huang et al. (1998).

For any arbitrary time-series data set X(t), we can always have its Hilbert-transform Y(t) as

As the X(t) and Y(t) are the corresponding real part and imaginary part ,then we use X(t) and Y(t) to form the complex conjugate pair, and get an analytic signal Z(t) as

Which a(t) represents the time-series amplitudes, and (t) represents the time-series phase. Since X(t) and Y(t) are both instantaneous values, θ(t) can indicate the changing value of the phase between two continue points. Now we can define the instantaneous frequency of Hilbert transform through the phase:

Therefore, the mean frequency F of an IMF can be presented as:

= 𝑁∑ ( )

Pearson correlation coefficient

Correlation coefficient can be used to describe the linear relationship between two variables. That is to use a number to indicate the relationship between the two variables and the direction of this relationship (positive or negative). Covariance can be used in finding out the correlation between two random variables. CovXY indicates the covariance of X and Y that is multiplying the distance of each group and adding up. It's expressed as follows:

= ∑(𝑋𝑖 𝑋̅)(𝑌𝑖 𝑌̅) 𝑁

The value would fall between positive and negative infinite. When the value is a positive number, Y would increase when X increase while if the value is a negative number, Y would decrease as X increase. However, the degree of correlation remains unknown therefore correlation coefficient can tell more about the correlation between X and Y. The formula of correlation coefficient is as follow:

= (𝑋 𝑌)

= ∑(𝑋𝑖 𝑋̅)(𝑌𝑖 𝑌̅)

√∑(𝑋𝑖 𝑋̅) ∑(𝑌𝑖 𝑌̅)

The σ is the standard deviation and the value will fall between -1 to +1.

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

33

Power percentage

Power percentage is a measure based on variance for detecting the weight of an IMF on the original data. A higher value of power percentage indicates a stronger weight an IMF is. The power percentage is defined as follows:

Powe e ce t ge(%) = VAR(IM )

VAR(o g l d t ) 00%

3.4 Significant IMFs

The study starts with the analysis of basic factors that determine the fluctuation of stock price. First, the data forecasted are TAIEX Futures. Futures are the stocks in the future, therefore the factors of TAIEX Index must be identified before forecasting TAIEX Futures and the indication of IMFs can be clearly defined through the statistical measures.

As mentioned before, the EEMD method proposed by Huang can decompose time-series data into several IMFs which have its own physical meaning. Since there are lots of IMFs decomposed from the data (TAIEX Index), we must to sort out the significant IMFs which are more meaningful to analyze.

In section 3.3, the statistical measures ―power percentage‖ is used to determine the significant IMFs, and the correlation coefficients ―Pearson coefficient‖ is used to compare the correlation between the significant components with the original data.

Moreover, the statistical measure ―mean period‖ can be indicated IMFs own specific meanings.

First of all, the factors of price fluctuation range widely and complicatedly.

Generally, the fluctuation of price is determined by the demands and supplies. There are investors choosing to sell out, there are ones who choose to buy in, and this is so-called trading behaviors. In TAIEX Index, the organizational investors hold the

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

34

dominant power on the market. Hence, the study attempted to identify the effects of organizational investors on TAIEX Index through the trading value of foreign and other investors.

The main approach for studying the fluctuation of stock prices can be categorized as follows:

1. Basic knowledge: analyze the basic situation of the macro-economy and the industries. The macro-economy reflects the integral operation efficacy and establishes the foundation for the further development of the enterprise. Therefore both macro-economy and the industries are closely related with the stock prices.

The basic knowledge of the industry includes, financial status, profiting…etc. The second riches entrepreneur, Warren E. Buffett believes he can make investment judgment in accordance with only basic knowledge.

2. Technicality: refer to the technical index, trend, and K-charts that reflect the fluctuation of price. The technical analysis only considers the real pricing behaviors in the market or of the financial tools. It is believed that ―the history repeats itself‖ and mass statistic data are used to forecast the direction of trends.

The study also adopts the moving average indictors in the technical index to assist trading.

3. Unexpected situation: when unexpected event occurs, the stock price may have severe fluctuations.

From the database of Taiwan Stock Exchange Corporation, only the data of Trading Value of Foreign & Other Investor from April, 2004 to July, 2012 were available therefore the prices of TAIEX Index from April, 2004 to July, 2012 were analyzed.

There are five IMFs and one residue exacted from the monthly TAIEX Index data by EEMD. The original data and the results of decomposition are shown in Figure 3.3&

3.4, and the statistical measures are listed in Table 3.4.

2004/4 2005/11 2007/7 2009/3 2010/11 2012/7

6000

2004/4 2005/11 2007/7 2009/3 2010/11 2012/7

4000

2004/4 2005/1 2005/11 2006/9 2007/7 2008/5 2009/3 2010/1 2010/11 2011/9 2012/7 6000

‧ 國

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

36

Table 3.4 the Statistical Measures of the Components Decomposed from TAIEX Index

Mean Pearson power

period(month) coefficient percentage

IMF1 3.16 0.2 2.65%

IMF2 8.04 0.39 4.73%

IMF3 22.52 0.66 16.88%

IMF4 50.52 0.89 34.35%

IMF5 71.65 0.08 0.83%

Residue 0.44 3.90%

Sum 63.33%

IMF3 and IMF4 are considered the most important. The power of percentage of IMF4 is about 34% and the latter is about 17%. In addition, the mean period of IMF3 is approximately two years while it is four years for IMF4 which suggests, the two years and four years loops of TAIEX Index are significant. However, from the perspectives of corporate profits, there are quarterly and annual reports. The influence of financial reports are expected to be seen in the data therefore IMF1 is seen as high frequency term, IMF2 and IMF3 are combined as mid frequency term, while IMF4 and IMF5 are the low frequency term based on the mean period. The four terms combined from the TAIEX Index components are shown in Figure 3.5.

period(month) coefficient percentage

High frequency term 3.21 0.21 2.46% approximately three months in the high frequency term, one year in the mid frequency term, and four years in the low frequency term. The influential orders from high to low are low frequency, mid frequency, trend, and high frequency on TAIEX Index.

Each frequency and trend is significant and analyzed.

-500

2004/4 2005/11 2007/7 2009/3 2010/11 2012/7

6000

2004/4-5 2005/11 2007/7 2009/3 2010/11 2012/7

0

2004/4 2005/11 2007/7 2009/3 2010/11 2012/7

6000

It is considered that high frequency term is greatly related to quarterly reports. The organization would also adjust their investments in accordance with quarterly reports.

To analyze the correlations between TAIEX Index and organizations, the Trading Value of Foreign & Other Investors was also decomposed as five IMFs and one

To analyze the correlations between TAIEX Index and organizations, the Trading Value of Foreign & Other Investors was also decomposed as five IMFs and one

相關文件