Document not found! Please try again

An Object-oriented Design and Implementation of ... - Semantic Scholar

Report 1 Downloads 206 Views
Journal of Convergence Information Technology Volume 5, Number 3, May 2010

Data Mining for Forecasting the Broiler Price Using Wavelet Transform Xudong Lin, Hanxing Liu*, Piyuan Lin, Meihua Wang College of Informatics, South China Agricultural University, Guangzhou 510642, China Corresponding author:[email protected](Hanxing Liu) doi: 10.4156/jcit.vol5.issue3.16

Abstract Forecasting the price of chicken plays a crucial important role in the poultry raising industry because it is beneficial to maximize the profit and minimize the risk. Its goal is to accurately predict the price in future based on the data obtained. ARMA is the classical time series prediction method and wavelet transform is well known to work well for reducing the noise of the data. In this paper, we perform ARMA with wavelet transform to get high accuracy of the chicken price forecasting.

Keywords: Price forecasting, time series, ARMA, wavelet transform 1. Introduction As the price of chicken fluctuates frequently, the chief executive officers of the poultry raising companies try to forecast the price of chicken to maximize the profit and minimize the risk. However, mining market tendency is a very challenging task due to its high volatility and noisy environment. They have been dependent heavily upon various types of intelligent systems to make trading decisions. However, the financial market is a complex, evolutionary, and non-linear dynamical system and it can be described as taking series of obtainable data < x1 , x2 ,..., xl > and predict data value of

< xl +1 , xl + 2 ,... > in the future [1,2,3]. In this paper, we will use the ARMA model and wavelet transform to resolve the real problems. The algorithm is applied to the dataset provided by one Group of Guangdong, P. R. China, which is the most famous poultry raising company in China. The results show that the forecasting accuracy of the proposed method using the ARMA model and wavelet transform is very high, and its generalization performance is also excellent. The rest of this paper is organized as follows: In Section 2, we will first shortly review the time series and ARMA Model, and in Section 3 we will introduce the wavelet transform model. A practical application using ARMA Model with wavelet transform is shown in Section 4 and some conclusions will be given in Section 5.

2. Time Series and ARMA Model 2.1 Forecasting Model of Time Series In this section, we will shortly review time series. As for the details one can refer to [4,5]. Let

X (t ) =< X (t1 ), X (t 2 ),..., X (t l ),... >

(1)

be a series of observed values at the time

t i (i = 1,2,..., l ,...) , or

X (t ) =, < x2 , t 2 >,..., < xl , t l >,... >

(2)

where

∆t = t 2 − t1 = t 3 − t 2 = ... = t l − t l −1 = ... . As ∆t are equal, we can shortly record

(3)

113

Data Mining for Forecasting the Broiler Price Using Wavelet Transform Xudong Lin, Hanxing Liu, Piyuan Lin, Meihua Wang

X =< x1 , x2 ,..., xl ,... > . The

forecasting

(4)

model

of

time

series

expects

to

estimate

xn (n > l )

by

< xn−m , xn−m+1 ,..., xn−2 , xn−1 > . 2.2 ARMA Model ARMA(p,q) can be described as following equation [6,7]:

xt = α 0 + α 1 xt −1 + ... + α p xt − p +

ε t + β1ε t −1 + ... + β q ε t −q

(5)

E (ε ) = 0,Var (ε ) = σ ε , E (ε s ε t) = 0( s ≠ t ) . 2

t t where Shortly we can formulate (5):

xt = α 0 + ∑i =1α i xt −i + ∑i =0 β i ε t −i p

where

q

(6)

β0 = 1.

If q=0, ARMA(p,q) is AR(p).

3. Wavelet Transform 3.1 Theory of Wavelet Transform

Haar wavelet is a wavelet evolved from "Continue Wavelet Transform"[8,9]. The equationψ (t ) presents a signal mother wavelet [10].

ψ ab (t ) = ψ ((t − b) / a) / a 

(7) In the equation (7), a represents the parameter of observation scale and b represents the parameter of parallel scale. As the time series data are discrete, the mother wavelet will become series equation like (8) [11]. +∞

CWT f (a, b) = (1 / a  ) ∫ ψ * ((t − b) / a )dt −∞

(8)

=< f ,ψ ab >

Consider input signal X(t),the multi resolution decomposition of the signal can be defined as[12]:

X (t ) = D1 (t ) + S1 (t ) = D1 (t ) + D2 (t ) + S 2 (t ) = D1 (t ) + D2 (t ) + D3 (t ) + S 3 (t )

(9)



= D1 (t ) + D2 (t ) + D3 (t ) + ... + DJ (t ) + S J (t ) 3.2 Forecasting Model of Wavelet Transform

X =< x1 , x2 ,..., xl ,... > is a time series. We will decompose it and reconstruct the result by

Set Haar wavelet:

114

Journal of Convergence Information Technology Volume 5, Number 3, May 2010

X = D1 + D2 + ... + DJ + S J where

(10)

D j =< d j ,1 , d j , 2 ,..., d j , N >, j = 1,2,..., J

So the time series expression:

and

S J =< s J ,1 , s J , 2 ,..., s J , N >

.

X =< x1 , x2 ,..., xl ,... > can be formulated by the following optimization

xk = d1,k + d 2,k + ... + d J ,k + s J ,k

(11)

x (k = 1,2,..., l ) have been observed. Then we can forecast the xl + k (k = 1,2,...) as The k following formula:

xˆl + k = dˆ1,l + k + dˆ2,l + k + ... + dˆ J ,l + k + sˆ J ,l + k where (1)

dˆ1,l + k , dˆ 2,l + k ,..., dˆ J ,l + k , sˆ J ,l + k Build

two

AR(p)

(12)

can be estimated by AR(p) as follow two steps.

models

by

D j =< d j ,1 , d j , 2 ,..., d j , N >, j = 1,2,..., J

and

S J =< s J ,1 , s J , 2 ,..., s J , N > d j ,t = α 1d j ,t −1 + α 2 d j ,t −2 ,..., d j ,t − p + ε t

(13)

s J ,t = β1 s J ,t −1 + β 2 s J ,t −2 ,..., β J s J ,t − p + ε t (2)

Utilize the AR(p) models to estimate

(14)

dˆ1,l + k , dˆ 2,l + k ,..., dˆ J ,l + k , sˆ J ,l + k

p dˆ j ,l +1 = ∑i =1α i d j ,l +1−i , ( j = 1,2,...J )

(15)

dˆ j ,l + k = ∑i =1α i dˆ j ,l + k −i + ∑i =k α i d j ,l + k −i , k −1

p

( j = 1,2,...J ,1 < k ≤ p)

(16)

dˆ j ,l + k = ∑i =1α i dˆ j ,l + k −i , k −1

( j = 1,2,...J , p < k )

(17)

sˆ J ,l +1 = ∑i =1 β i s J ,l +1−i p

(18)

sˆ J ,l + k = ∑i =1 β i sˆ J ,l + k −i + ∑i =k β i s J ,l + k −i , k −1

p

(1 < k ≤ p)

(19)

sˆ J ,l + k = ∑i =1 β i sˆ J ,l + k −i , ( p < k ) k −1

(20)

4. Practical Application Using ARMA Model with Wavelet Transform In this section, we will use the ARMA model and wavelet transform model to forecast the price of chicken. The experiments are run on a PC with a 2.4GHz Pentium IV processor and a maximum of 2GB memory. The program is written in C++, using Microsoft’s Visual C++ 6.0 compiler. In order to evaluate the validity of the models, the algorithm is applied to the dataset of distribution achievement of the famous company of Guangdong in China.

115

Data Mining for Forecasting the Broiler Price Using Wavelet Transform Xudong Lin, Hanxing Liu, Piyuan Lin, Meihua Wang 9 8 7 6 5 4 3 2 1 0 1 43 85 127 169 211 253 295 337 379 421 463 505 547 589 631 the average price of chicken(week)

Figure 1. the week’s average price of chicken from Apr. 1997 to Sep. 2009 The dataset is listed in the Figure 1, which consists of 662 data points. We use the first 512 data points as the training dataset and the next 150 data points as the test dataset.

4.1 ARMA(p,q) Model First we observe the experiment result simply using ARMA Model. We set p=4, q=0, and use the AR(4) to forecast. We compute the parameters:

α 0 = 0.168137856, α 1 = 1.21332635, α 2 = -0.274221562, α 3 = -0.075381854, α 4 = 0.093661505 So,

xt = 0.168137856 + 1.21332635 xt −1 - 0.274221562 xt −2 - 0.075381854 xt −3

(21)

+ 0.093661505 xt −4 The forecasting result is showed in Figure 2 and the error rate is showed in Figure 3. The average error rate is 4.594%. 7 6 5 4 3 2 1 0 1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 the real price the forecasting price

Figure 2. The real price and the forecasting price using AR(4)

116

Journal of Convergence Information Technology Volume 5, Number 3, May 2010 0.25 0.2 0.15 0.1 0.05 0 -0.05 1 12 23 34 45 56 67 78 89 100 111 122 133 144 -0.1 -0.15 -0.2 -0.25 the error rate using AR(4)

Figure 3. The error rate using AR(4)

4.2 Proposed Method The main idea of the proposed method using ARMA Model with wavelet transform is as follow. We utilize Haar arithmetic (equation (8),(9)) to decompose the dataset. Then we use AR(4) to forecast. Finally we reconstruct the results by Haar arithmetic(equation (12)-(20)). The processing data are showed in Figure 4 to Figure 10. 9 8 7 6 5 4 3 2 1 0 1

34 67 100 133 166 199 232 265 298 331 364 397 430 463 496

the training dataset(X(t))

Figure 4. The training dataset 9 8 7 6 5 4 3 2 1 0 1

37

73 109 145 181 217 253 289 325 361 397 433 469 505

one level wavelet(approximation signal S1)

Figure 5. One level wavelet(approximation signal)

117

Data Mining for Forecasting the Broiler Price Using Wavelet Transform Xudong Lin, Hanxing Liu, Piyuan Lin, Meihua Wang 2 1.5 1 0.5 0 -0.5

1

39

77 115 153 191 229 267 305 343 381 419 457 495

-1 -1.5 -2 -2.5

one level wavelet(detail signal D1)

Figure 6. One level wavelet(detail signal) 9 8 7 6 5 4 3 2 1 0 1

37

73 109 145 181 217 253 289 325 361 397 433 469 505

two level wavelet(approximation signal S2)

Figure 7. Two level wavelet(approximation signal) 2 1.5 1 0.5 0 1

39 77 115 153 191 229 267 305 343 381 419 457 495

-0.5 -1 -1.5 -2 -2.5

two level wavelet(detail signal D2)

Figure 8. Two level wavelet(detail signal)

118

Journal of Convergence Information Technology Volume 5, Number 3, May 2010 9 8 7 6 5 4 3 2 1 0 1

37

73 109 145 181 217 253 289 325 361 397 433 469 505

three level wavelet(approximation signal S3)

Figure 9. Three level wavelet(approximation signal) 2 1.5 1 0.5 0 -0.5

1

39

77 115 153 191 229 267 305 343 381 419 457 495

-1 -1.5 -2 -2.5

three level wavelet(detail signal D3)

Figure 10. Three level wavelet(detail signal) The forecasting result is showed in Figure 11 and the error rate is showed in Figure 12. The average error rate is 3.043%. 7 6 5 4 3 2 1 0 1 10 19 28 37 46 55 64 73 82 91 100 109 118 127 136 145

the real price the forecasting price Figure 11. The real price and the forecasting price using wavelet transform

119

Data Mining for Forecasting the Broiler Price Using Wavelet Transform Xudong Lin, Hanxing Liu, Piyuan Lin, Meihua Wang

0.12 0.1 0.08 0.06 0.04 0.02 0 -0.02 1 12 23 34 45 56 67 78 89 100 111 122 133 144 -0.04 -0.06 the error rate using wavelet transform Figure 12. The error rate using wavelet transform

5. Conclusion Time series and wavelet transform are very powerful and useful tools which have been widely applied in every different aspect of optimization systems. There are three reasons for a better performance of our proposed system. First of all, the wavelet process can further reduce the noise of the data. Secondly, the ARMA algorithm is applied to forecast the result of the multi resolution decomposition of the price. Finally, we reconstruct the result properly. The average error rate is 3.043%. From the results of the practical problem, we can clearly report the good general performance of ARMA model and wavelet transform.

6. Acknowledgments This work has been supported by the National 863 High-Tech Research & Development Plan of China under Grant No. 2006AA10Z246, the National Natural Science Foundation of China under Grant No. 60573043, the Science & Technology Research Project of Guangdong Province under Grant No. 2007A020300010, No. 2009B090300059, and Start-up Funding of South China Agricultural University under Grant No. 5600-K08010.

7. References [1] Chen F, Han CZ. Time series forecasting based on wavelet KPCA and support vector machine.

IEEE International Conference on Automation and Logistics. Jinan, China. August, 2007, pp. 14871491 [2] Chang,PC, Fan CY, Chen SH. Financial time series data forecasting by Wavelet and TSK fuzzy rule based system. 4th International Conference on Fuzzy Systems and Knowledge Discovery. Haikou, China . August, 2007, pp. 331-335 [3] Su Juan, Du, Song-Huai, Li Cai-Hua. Neural network short-term spot price forecast based on multifactor wavelet analysis. Electric Power Automation Equipment. Electric Power Automation Equipment Press, Nanjing, China. November, 2007, 27(11), pp. 26-29 [4] Adamowski, Jan F. Development of a short-term river flood forecasting method for snowmelt driven floods based on wavelet and cross-wavelet analysis. Journal of Hydrology. Elsevier, Amsterdam, 1000 AE, Netherlands. May, 2008, 353(3-4), pp.247-266 [5] Liu Bin-Sheng, Li Yi-Jun, and Xing Zhan-Wen. Research on freight traffic forecast based on wavelet and support vector machine. Proceedings of the 2006 International Conference on Machine Learning and Cybernetics, ICMLC 2006. Dalian, China. August, 2006, pp. 2524-2530

120

Journal of Convergence Information Technology Volume 5, Number 3, May 2010 [6] Zhou Ming, Nie Yan-Li, Li Geng-Yin, Ni Yi-Xin. Wavelet analysis based arima hourly electricity prices forecasting approach. Power System Technology. Power System Technology Press, Bejing, China. May, 2005, 29(9), pp. 50-55 [7] Nengling Tai, Stenzel Jurgen, Hongxiao Wu. Techniques of applying wavelet transform into combined model for short-term load forecasting. Electric Power Systems Research. Elsevier Ltd, Oxford, OX5 1GB, United Kingdom. April, 2006, 76( 6-7), pp. 525-533 [8] Li Li, Qu Liangsheng and Liao Xianghui. Haar wavelet for machine fault diagnosis. Mechanical Systems and Signal Processing. London: NW1 7DX, United Kingdom(Academic Press). May, 2007, 21(4), pp. 1773-1786 [9] Cao J.C., Cao S.H. Study of forecasting solar irradiance using neural networks with preprocessing sample data by wavelet analysis. Energy. Elsevier Ltd, Oxford, OX5 1GB, United Kingdom. December, 2006, 31(15), pp. 3435-3445 [10] Cheng Bao-Qing, Han Feng-Qin, Gui Zhong-Hua. Application of wavelet transform based grey theory to fault forecasting of hydroelectric generating sets. Power System Technology. Power System Technology Press, Bejing, China. July, 2005, 29(13), pp. 40-44 [11] Kim Tae-Woong, Valdes Juan B. Nonlinear model for drought forecasting based on a conjunction of wavelet transforms and neural networks. Journal of Hydrologic Engineering. American Society of Civil Engineers. November/December, 2003, 8(6). pp. 319-328 [12] Wang WG, Luo YF. Wavelet network model for reference crop evapotranspiration forecasting. 5th International Conference on Wavelet Analysis and Pattern Recognition. Beijing, China. November, 2007, pp. 751-755

121