摘要:針對(duì)生豬價(jià)格波動(dòng)過(guò)于劇烈難以預(yù)測(cè)的問(wèn)題,提出基于奇異譜分解的LSTM-ARIMA組合模型對(duì)生豬價(jià)格進(jìn)行預(yù)測(cè)。以2000年1月—2021年12月的月度價(jià)格數(shù)據(jù)作為樣本,利用奇異譜分析對(duì)生豬價(jià)格數(shù)據(jù)進(jìn)行分解,得到趨勢(shì)項(xiàng)和波動(dòng)項(xiàng),選用累計(jì)貢獻(xiàn)率達(dá)前70%的構(gòu)建趨勢(shì)項(xiàng),剩下的30%構(gòu)造波動(dòng)項(xiàng)。趨勢(shì)項(xiàng)非平穩(wěn)且具有長(zhǎng)記憶性,對(duì)其建立LSTM模型;波動(dòng)項(xiàng)平穩(wěn),對(duì)其建立ARIMA模型,最后將兩部分預(yù)測(cè)結(jié)果重組作為生豬價(jià)格的預(yù)測(cè)值,構(gòu)建LSTM-ARIMA組合預(yù)測(cè)模型。將預(yù)測(cè)值和生豬真實(shí)價(jià)格進(jìn)行對(duì)比,結(jié)果表明:預(yù)測(cè)值與真實(shí)值之間的均方根誤差RMSE為2.75,平均絕對(duì)百分比誤差MAPE為10.81%,平均絕對(duì)誤差MAE為2.27,方向?qū)ΨQ性DS為81.81;此組合模型能很好地預(yù)測(cè)生豬價(jià)格走勢(shì),對(duì)我國(guó)生豬價(jià)格預(yù)測(cè)具有更高地適用性與參考。
關(guān)鍵詞:生豬價(jià)格預(yù)測(cè);奇異譜分析;組合模型;LSTM;ARIMA
中圖分類號(hào):F323.7
文獻(xiàn)標(biāo)識(shí)碼:A
文章編號(hào):2095-5553 (2024) 05-0176-07
收稿日期:2022年6月12日" 修回日期:2022年8月10日*基金項(xiàng)目:國(guó)家自然科學(xué)基金(72363019)
第一作者:付蓮蓮,女,1981年生,江西九江人,博士,教授,碩導(dǎo);研究方向?yàn)樯i價(jià)格波動(dòng)與預(yù)測(cè)。E-mail:" fulianhappy@163.com
Forecasting of pig price fluctuation based on SSA and LSTM-ARIMA combination model
Fu Lianlian, Fang Qing, Yuan Dongyu, Teng Jiamin
(School of Computer and Information Engineering, Jiangxi Agricultural University, Nanchang, 330045, China)
Abstract:
Aiming at the problem that the fluctuation of pig price is too violent and difficult to predict, a LSTM-ARIMA combination model based on singular spectrum decomposition is proposed to predict pig price. Taking the monthly price data from January 2000 to December 2021 as a sample, the pig price data is decomposed by singular spectrum analysis to obtain the trend term and fluctuation term. The trend term with the cumulative contribution rate of the first 70% is selected to construct the trend term, and the remaining 30% is used to construct the fluctuation term. The trend item is non-stationary and has long memory, and the LSTM model is established. The fluctuation term is stable, and the ARIMA model is established. Finally, the prediction results of the two parts are recombined as the prediction value of pig price, and the LSTM-ARIMA combined prediction model is constructed. The results show that the RMSE between the predicted value and the real value is 2.75, MAPE is 10.81%, MAE is 2.27 and DS is 81.81. This combined model can well predict the price trend of newborn pigs, and has higher applicability and reference value for the prediction of pig prices in China.
Keywords:
forecast of pig price; singular spectrum analysis; combination model; LSTM; ARIMA
0 引言
中國(guó)是世界上最大的豬肉生產(chǎn)國(guó)和消費(fèi)國(guó),豬肉消費(fèi)在我國(guó)肉類消費(fèi)中占據(jù)了居民消費(fèi)總量的60%以上。2021年以來(lái),豬肉價(jià)格在新冠肺炎疫情和非洲豬瘟的雙重影響下,又經(jīng)歷了一次“過(guò)山車”似的波動(dòng)。2021年全國(guó)平均生豬價(jià)格為20.78元/kg,同比下降38.58%[1]。對(duì)生豬價(jià)格進(jìn)行準(zhǔn)確預(yù)測(cè)可以給農(nóng)戶未來(lái)的生產(chǎn)養(yǎng)殖提供參考,方便生豬產(chǎn)業(yè)鏈上各主體及時(shí)采取措施盡可能地減少波動(dòng)帶來(lái)的損失。
目前,國(guó)內(nèi)外對(duì)生豬價(jià)格的預(yù)測(cè)方法較為多樣,從多元線性回歸、向量自回歸模型到ARIMA時(shí)間序列和SVM、神經(jīng)網(wǎng)絡(luò)等機(jī)器學(xué)習(xí)模型,再到現(xiàn)在趨于復(fù)雜的組合模型[2]。Kurumatani[3]用遞歸的神經(jīng)網(wǎng)絡(luò)模型對(duì)農(nóng)產(chǎn)品價(jià)格進(jìn)行了預(yù)測(cè),精度較高,方法的優(yōu)點(diǎn)是訓(xùn)練所需的時(shí)間序列長(zhǎng)度足夠短。劉怡然等[4]采用螢火蟲算法對(duì)長(zhǎng)短時(shí)記憶神經(jīng)網(wǎng)絡(luò)進(jìn)行參數(shù)優(yōu)化,解決了生豬價(jià)格序列在時(shí)間軸上的遲滯問(wèn)題。王澤鵬等[5]將改進(jìn)網(wǎng)絡(luò)結(jié)構(gòu)的時(shí)間卷積網(wǎng)絡(luò)(TCN)模型方法和RFR、XGBoost、LightGBM三種機(jī)器學(xué)習(xí)模型對(duì)比,對(duì)西南地區(qū)某省的生豬價(jià)格進(jìn)行預(yù)測(cè),結(jié)果顯示TCN模型預(yù)測(cè)結(jié)果更為精確。
國(guó)內(nèi)學(xué)者以BP神經(jīng)網(wǎng)絡(luò)、LSTM和ARIMA等模型為基礎(chǔ)構(gòu)建組合模型來(lái)進(jìn)行預(yù)測(cè)[6],得出LSTM在故障時(shí)間序列預(yù)測(cè)中具有很強(qiáng)的適應(yīng)性和更高的準(zhǔn)確性[7, 8]。在預(yù)測(cè)時(shí)間序列數(shù)據(jù)時(shí)ARIMA模型被較多使用,已經(jīng)用在新鮮蔬菜、糧食等農(nóng)產(chǎn)品價(jià)格預(yù)測(cè)上[9-11]。對(duì)于時(shí)間序列數(shù)據(jù)上下波動(dòng)過(guò)于劇烈時(shí)難以預(yù)測(cè)的問(wèn)題沒(méi)有得到很好的解決[12],主要原因在于時(shí)間序列數(shù)據(jù)有波動(dòng)、趨勢(shì)和不規(guī)則成分,不進(jìn)行分解而直接進(jìn)行預(yù)測(cè),則會(huì)影響預(yù)測(cè)精度。引發(fā)本文的思考:是否可以將原始序列分解,再與其他模型重構(gòu)組合的方法對(duì)生豬價(jià)格進(jìn)行預(yù)測(cè)以此增加結(jié)果的精確性。
奇異譜分析(SSA)是一種處理非線性時(shí)間序列數(shù)據(jù)的方法,它能夠從原始時(shí)間序列中分解出趨勢(shì)、振蕩分量和噪聲等幾個(gè)獨(dú)立的、具有某種規(guī)律的子序列,然后根據(jù)子序列建立對(duì)應(yīng)的模型,以此來(lái)降低模型的復(fù)雜度并提高模型的預(yù)測(cè)精確度[13-16],有學(xué)者將奇異譜分析法(SSA)與長(zhǎng)短時(shí)記憶網(wǎng)絡(luò)(LSTM)組合,證實(shí)了分解后的組合模型精度較高[17]。
生豬價(jià)格受季節(jié)、周期、貨幣、外部沖擊等多種因素的影響,具有顯著的趨勢(shì)性、隨機(jī)性和周期性[18]。在趨勢(shì)、隨機(jī)和波動(dòng)特征明顯的時(shí)間序列數(shù)據(jù)的預(yù)測(cè)研究上,需要運(yùn)用合適的分解方法分解出價(jià)格的不同成分,對(duì)各成分進(jìn)行預(yù)測(cè),之后再整合成最終的預(yù)測(cè)結(jié)果。僅僅運(yùn)用單一模型對(duì)其進(jìn)行預(yù)測(cè),對(duì)存在趨勢(shì)、隨機(jī)和周期性的生豬價(jià)格預(yù)測(cè)存在較大的局限性。鑒于此,首先進(jìn)行奇異譜分析,根據(jù)累計(jì)貢獻(xiàn)率將生豬價(jià)格數(shù)據(jù)分解為趨勢(shì)項(xiàng)和波動(dòng)項(xiàng)構(gòu)造出新的時(shí)間序列,再對(duì)這兩個(gè)子序列根據(jù)序列特征分別采用合適的模型進(jìn)行預(yù)測(cè),最后,將兩部分預(yù)測(cè)結(jié)果重組,完成對(duì)生豬價(jià)格的LSTM-ARIMA預(yù)測(cè)。
1 研究方法
1.1 奇異譜分析
奇異譜分析(SSA)方法是Colebrook在1978年提出的,它基于構(gòu)造在時(shí)間序列上的特定矩陣的奇異值分解(SVD),可以從一個(gè)時(shí)間序列中分解出趨勢(shì)、振蕩分量和噪聲。它具有廣泛的適用性,分析時(shí)間序列時(shí),既不用假設(shè)參數(shù)模型,也不需要假設(shè)平穩(wěn)性條件。俞肇元等[15]證明了奇異譜分析是提取不同周期分量最有效方法之一。
對(duì)于生豬價(jià)格時(shí)間序列{y1,y2,…,yT},首先選擇合適的窗口長(zhǎng)度K,將其進(jìn)行滯后排列,如式(1)所示。
3 結(jié)論
由于生豬價(jià)格具有非線性、非平穩(wěn)特征,本文利用奇異譜分析的分解能力,根據(jù)特定的累計(jì)貢獻(xiàn)率將生豬價(jià)格數(shù)據(jù)分解成波動(dòng)項(xiàng)與趨勢(shì)項(xiàng)。利用LSTM模型適合預(yù)測(cè)平滑與具有長(zhǎng)記憶性的數(shù)據(jù)的特性對(duì)趨勢(shì)項(xiàng)進(jìn)行建模,利用ARIMA模型適合預(yù)測(cè)平穩(wěn)時(shí)間序列的數(shù)據(jù)的特性對(duì)波動(dòng)項(xiàng)進(jìn)行建模,最后將兩組模型的預(yù)測(cè)值相加得出最終預(yù)測(cè)值。
1)" 預(yù)測(cè)值與真實(shí)值對(duì)比顯示,除6月、7月和11月、12月的價(jià)格波動(dòng)趨勢(shì)存在不同,其余月份均與實(shí)際趨勢(shì)一致,說(shuō)明該組合模型對(duì)波動(dòng)突然劇烈變大的時(shí)間序列預(yù)測(cè)可以得出較為有效的結(jié)果。
2)" 選定RMSE、MAPE、MAE和DS四個(gè)指標(biāo)對(duì)模型的性能進(jìn)行檢測(cè),與真實(shí)值對(duì)比顯示,12個(gè)月的RMSE為2.75,MAPE為10.81%,MAE為2.27,組合模型的預(yù)測(cè)精度較好。
3)" 12個(gè)月的DS值為81.81,說(shuō)明組合模型預(yù)測(cè)實(shí)際數(shù)據(jù)的走勢(shì)方向精度很高,基于奇異譜分析的LSTM-ARIMA模型對(duì)生豬價(jià)格的預(yù)測(cè)效果較好。
與國(guó)內(nèi)大部分研究不同的是,本文并沒(méi)有直接對(duì)原始時(shí)間序列直接進(jìn)行總體的預(yù)測(cè),而是使用奇異譜分析將原序列分解,再根據(jù)子序列的特征選取合適的模型進(jìn)行預(yù)測(cè)分析,得出精度更優(yōu)的預(yù)測(cè)結(jié)果,驗(yàn)證奇異譜分析與LSMT模型和ARIMA模型的組合在價(jià)格預(yù)測(cè)中的適用性,拓寬奇異譜分析的運(yùn)用領(lǐng)域。但需要指出的是,采用奇異譜分析得出結(jié)果時(shí)可將累計(jì)貢獻(xiàn)率的分配進(jìn)行調(diào)整,選擇預(yù)測(cè)結(jié)果更好的貢獻(xiàn)率累計(jì)來(lái)進(jìn)行模型組合。數(shù)據(jù)合理分配有利于得出更好的結(jié)果。LSTM模型參數(shù)眾多,參數(shù)的選擇會(huì)直接影響模型的預(yù)測(cè)結(jié)果,因此,下一步對(duì)LSTM模型的運(yùn)行機(jī)制和參數(shù)運(yùn)用數(shù)學(xué)優(yōu)化算法進(jìn)行優(yōu)化。
參 考 文 獻(xiàn)
[1] 楊侗瑨, 王祖力, 劉小紅, 等. 2021年中國(guó)生豬產(chǎn)業(yè)發(fā)展情況及2022年趨勢(shì)[J]. 中國(guó)豬業(yè), 2022, 17(1): 19-24.
[2] 丁琳琳, 孟軍. 兩種模型對(duì)中國(guó)生豬價(jià)格預(yù)測(cè)效果的比較[J]. 統(tǒng)計(jì)與決策, 2012(4): 74-76.
[3] Kurumatani K. Time series forecasting of agricultural product prices based on recurrent neural networks and its evaluation method [J]. SN Applied Sciences, 2020, 2(8): 1434.
[4] 劉怡然, 王東杰, 鄧雪峰, 等. 基于長(zhǎng)短時(shí)記憶神經(jīng)網(wǎng)絡(luò)的生豬價(jià)格預(yù)測(cè)模型[J]. 江蘇大學(xué)學(xué)報(bào)(自然科學(xué)版), 2021, 42 (2): 190-197.
Liu Yiran, Wang Dongjie, Deng Xuefeng, et al. Prediction method of hog price based on long short term memory network model [J]. Journal of Jiangsu University (Natural Science Edition), 2021, 42(2): 190-197.
[5] 王澤鵬, 陳曉燕, 龐濤, 等. 一種基于改進(jìn)時(shí)間卷積網(wǎng)絡(luò)的生豬價(jià)格預(yù)測(cè)方法[J]. 中國(guó)農(nóng)業(yè)大學(xué)學(xué)報(bào), 2021, 26(12): 137-144.
Wang Zepeng, Chen Xiaoyan, Pang Tao, et al. A hog price prediction method based on improved temporal convolutional network [J]. Journal of China Agricultural University, 2021, 26(12): 137-144.
[6] 王鑫, 吳際, 劉超, 等. 基于LSTM循環(huán)神經(jīng)網(wǎng)絡(luò)的故障時(shí)間序列預(yù)測(cè)[J]. 北京航空航天大學(xué)學(xué)報(bào), 2018, 44(4): 772-784.
Wang Xin, Wu Ji, Liu Chao, et al. Exploring LSTM based recurrent neural network for failure time series prediction [J]. Journal of Beijing University of Aeronautics and Astronautics, 2018, 44(4): 772-784.
[7] 李靜, 徐路路. 基于機(jī)器學(xué)習(xí)算法的研究熱點(diǎn)趨勢(shì)預(yù)測(cè)模型對(duì)比與分析——BP神經(jīng)網(wǎng)絡(luò)、支持向量機(jī)與LSTM模型[J]. 現(xiàn)代情報(bào), 2019, 39(4): 23-33.
Li Jing, Xu Lulu. Comparison and analysis of research trend prediction models based on machine learning algorithm: BP neural network, support vector machine and LSTM model [J]. Journal of Modern Information, 2019, 39(4): 23-33.
[8] 胡劍波, 羅志鵬, 李峰. “碳達(dá)峰”目標(biāo)下中國(guó)碳排放強(qiáng)度預(yù)測(cè)——基于LSTM和ARIMA-BP模型的分析[J]. 財(cái)經(jīng)科學(xué), 2022(2): 89-101.
Hu Jianbo, Luo Zhipeng, Li Feng. Prediction of China’s carbon emission intensity under the goal of carbon peak: Analysis based on LSTM and ARIMA-BP model [J]. Finance amp; Economics, 2022(2): 89-101.
[9] 劉峰, 王儒敬, 李傳席. ARIMA模型在農(nóng)產(chǎn)品價(jià)格預(yù)測(cè)中的應(yīng)用[J]. 計(jì)算機(jī)工程與應(yīng)用, 2009, 45(25): 238-239.
Liu Feng, Wang Rujing, Li Chuanxi. Application of ARIMA model in forecasting agricultural product price [J]. Computer Engineering and Applications, 2009, 45(25): 238-239.
[10] 翟靜, 曹俊. 基于時(shí)間序列ARIMA與BP神經(jīng)網(wǎng)絡(luò)的組合預(yù)測(cè)模型[J]. 統(tǒng)計(jì)與決策, 2016(4): 29-32.
[11] 彭紅星, 鄭楷航, 黃國(guó)彬, 等. 基于BP、LSTM和ARIMA模型的蔬菜價(jià)格預(yù)測(cè)[J]. 中國(guó)農(nóng)機(jī)化學(xué)報(bào), 2020, 41(4): 193-199.
Peng Hongxing, Zheng Kaihang, Huang Guobin, et al. Vegetable price prediction based on BP, LSTM and ARIMA models [J]. Journal of Chinese Agricultural Mechanization, 2020, 41(4): 193-199.
[12] Jannah M, Sadik K, Afendi F M. Study of forecasting method for agricultural products using hybrid ANN-GARCH approach [J]. Journal of Physics: Conference Series, 2021, 1863(1): 12052-12056.
[13] 梁小珍, 郭戰(zhàn)坤, 張倩文, 等. 基于奇異譜分析的航空客運(yùn)需求分析與分解集成預(yù)測(cè)模型[J]. 系統(tǒng)工程理論與實(shí)踐, 2020, 40(7): 1844-1855.
Liang Xiaozhen, Guo Zhankun, Zhang Qianwen, et al. An analysis and decomposition ensemble prediction model for air passenger demand based on singular spectrum analysis [J]. Systems Engineering Theory amp; Practice, 2020, 40(7): 1844-1855.
[14] 王勇, 劉瑩, 張娜. 基于奇異譜分析的旅游人數(shù)集成預(yù)測(cè)模型的研究與應(yīng)用: 以中國(guó)為例[J]. 系統(tǒng)科學(xué)與數(shù)學(xué), 2020, 40(9): 1628-1643.
Wang Yong, Liu Ying, Zhang Na. Research and application of integrated forecast model for number of tourists based on singular spectrum analysis: A case study of China [J]. Journal of Systems Science and Mathematical Sciences, 2020, 40(9): 1628-1643.
[15] 俞肇元, 袁林旺, 謝志仁, 等. 基于時(shí)間序列分解的海面變化預(yù)測(cè)[J]. 南京師大學(xué)報(bào)(自然科學(xué)版), 2007(1): 117-121.
Yu Zhaoyuan, Yuan Linwang, Xie Zhiren, et al. Sea level prediction based on time series model [j]. Journal of Nanjing Normal University (Natural Science Edition), 2007(1): 117-121.
[16] 肖白, 肖志峰, 姜卓, 等. 基于降噪自編碼器、奇異譜分析和長(zhǎng)短期記憶神經(jīng)網(wǎng)絡(luò)的空間電力負(fù)荷態(tài)勢(shì)感知[J]. 中國(guó)電機(jī)工程學(xué)報(bào), 2021, 41(14): 4858-4867.
Xiao Bai, Xiao Zhifeng, Jiang Zhuo, et al. Spatial load situation awareness based on denoising autoencoder, singular spectrum analysis and long short-term memory neural networks [J]. Proceedings of the CSEE, 2021, 41(14): 4858-4867.
[17] 李麗敏, 張明岳, 溫宗周, 等. 基于奇異譜分析法和長(zhǎng)短時(shí)記憶網(wǎng)絡(luò)組合模型的滑坡位移預(yù)測(cè)[J]. 信息與控制, 2021, 50(4): 459-469.
Li Limin, Zhang Mingyue, Wen Zongzhou, et al. Landslide displacement prediction based on singular spectrum analysis and a combined long short-term memory neural network model [J]. Information and Control, 2021, 50(4): 459-469.
[18] 付蓮蓮, 羅千峰. 生豬價(jià)格波動(dòng)特征及形成機(jī)理的異質(zhì)性——基于M-K檢驗(yàn)和協(xié)方差分析[J]. 中國(guó)農(nóng)業(yè)大學(xué)學(xué)報(bào), 2018, 23(11): 196-205.
Fu Lianlian, Luo Qianfeng. Heterogeneity of the characteristics and formation mechanism of hog price’s volatility: Based on M-K test and covariance analysis [J]. Journal of China Agricultural University, 2018, 23(11): 196-205.
[19] 雷可為, 陳瑛. 基于BP神經(jīng)網(wǎng)絡(luò)和ARIMA組合模型的中國(guó)入境游客量預(yù)測(cè)[J]. 旅游學(xué)刊, 2007(4): 20-25.
Lei Kewei, Chen Ying. Forecast of inbound tourists to China based on BP neural network and ARIMA combined model [J]. Tourism Tribune, 2007(4): 20-25.