主管:中国科学院
主办:中国优选法统筹法与经济数学研究会
   中国科学院科技战略咨询研究院

中国管理科学 ›› 2025, Vol. 33 ›› Issue (5): 113-123.doi: 10.16381/j.cnki.issn1003-207x.2023.0885cstr: 32146.14/j.cnki.issn1003-207x.2023.0885

• • 上一篇    下一篇

基于双层Attention机制的LSTM模型对CPI的预测研究

董曼茹1, 唐晓彬2()   

  1. 1.北京物资学院系统科学与统计学院,北京 101149
    2.对外经济贸易大学统计学院,北京 100029
  • 收稿日期:2023-05-29 修回日期:2023-07-20 出版日期:2025-05-25 发布日期:2025-06-04
  • 通讯作者: 唐晓彬 E-mail:tangxb@uibe.edu.cn
  • 基金资助:
    国家社会科学基金重大项目(22&ZD164);全国统计科学研究重点项目(2023LZ007);北京物资学院青年科研基金项目(2023XJQN05)

Study on CPI Prediction by LSTM Model Based on Double-Layer Attention Mechanism

Manru Dong1, Xiaobin Tang2()   

  1. 1.School of Systems Science and Statistics,Beijing Wuzhi University,Beijing 101149,China
    2.School of Statistics,University of International Business and Economics,Beijing 100029,China
  • Received:2023-05-29 Revised:2023-07-20 Online:2025-05-25 Published:2025-06-04
  • Contact: Xiaobin Tang E-mail:tangxb@uibe.edu.cn

摘要:

国内外经济形势日趋复杂多变的背景下,及时准确地预测消费者价格指数(CPI),对于提振消费信心、落实扩大内需战略具有重要作用。针对CPI动态变化的多维性特征和发布的滞后性问题,结合自然语言处理技术构建CPI预测数据集,将双层Attention机制引入到LSTM神经网络结构,构建ATT-LSTM-ATT模型应用于CPI预测,同时引入多个机器学习模型(ATT-LSTM、LSTM、SVR、RF、XGBoost和LGBM)作对比和交叉验证分析。研究发现:(1)双层Attention机制能够动态关注特征和时序两个维度的关键信息,强化LSTM模型对房地产政策、双十一和节假日等的注意力分配,凸显重要特征和重要时点对CPI变动的影响,有效提升模型对CPI预测的精准度;(2)与其他六种机器学习预测模型相比,ATT-LSTM-ATT模型预测效果更优,对不同期限CPI预测发现该模型具有较强的稳定性,同时不同机器学习模型在CPI不同期限预测表现出异质性特征;(3)文本挖掘数据能够提前把握居民消费动态,综合文本挖掘构建数据集与ATT-LSTM-ATT模型预测出的CPI值比官方发布时间提前约3周。本文结合大数据和机器学习方法提出的双层Attention机制的LSTM模型,为CPI的预测预判提供新的研究思路,能够及时调整消费市场的不稳定现象,为宏观经济管理和调控提供参考价值。

关键词: CPI, 居民消费, LSTM模型, Attention机制, 机器学习模型

Abstract:

Against the backdrop of an increasingly complex and volatile domestic and international economy, timely and accurate prediction of the consumer price index (CPI) plays an important role in boosting consumer confidence, promoting consumption upgrading and implementing the strategy of expanding domestic demand. However, as the complexity of economic operations increases, new industries and new modes of business continue to emerge and resident consumption patterns change, traditional statistical survey data are not conducive to accurate economic expectations and a timely grasp of changes in consumer prices due to their time lag and low frequency. Especially under the impact of big data, the traditional predictive methods and timeliness can no longer well meet the needs of economic development and policy formulation, thus exacerbating the lag in the formulation of the relevant policies, which may lead to bias in the implementation of the corresponding policies. The development of big data technology and the rise of machine learning provide ideas for solving the problems of timeliness, accuracy and complexity of CPI prediction. The purpose of this paper is to construct a predictive model of CPI using big data technology and machine learning methods, with a view to realizing a timely and accurate prediction of CPI.Aiming at the problem of CPI prediction, the natural language processing technology based on TF-IDF algorithm and BERT model are adopted to construct the CPI predictive dataset. Secondly, Multi-Representational Attention and Soft-Attention are introduced into the LSTM neural network structure respectively, which enables the model to dynamically deploy the attention to the features and temporal sequences of dataset, and ATT-LSTM-ATT model is constructed and applied to the CPI prediction problem. Thirdly, several machine learning models (including ATT-LSTM, LSTM, SVR, RF, XGBoost, and LGBM) are introduced for comparison and cross-validation analysis, respectively. Finally, the effect of introducing Attention mechanism on the predictive ability of LSTM model is explored, the accuracy and robustness of ATT-LSTM-ATT model for CPI prediction is tested, and explore the heterogeneity of multiple machine learning models for CPI prediction of different prediction sets is explored.The results of this paper show that (1) The introduction of Multi-Representational Attention mechanism and Soft-Attention mechanism effectively improves the prediction effect of LSTM model on CPI. The two-layer Attention mechanism can strengthen the LSTM model's attention allocation to real estate policies, double eleven and holidays, etc., and highlight the impact of important features and important points in time on the trend of CPI changes, which can effectively improve the prediction accuracy of the LSTM model for CPI. Therefore, the ATT-LSTM-ATT model has better features and time series attention allocation, time series memory and prediction functions, and has effectiveness and stability in the prediction of CPI. (2) Through the research of different machine learning models on the prediction of CPI in different periods, it is found that the ATT-LSTM-ATT model has strong stability, and different machine learning model shows heterogeneity in different prediction sets. The heterogeneity is characterized by the fact that RF, XGBoost and LGBM models are more suitable for short-term prediction of CPI, SVR is more suitable for long-term and medium-term prediction of CPI, and LSTM model is more suitable for long-term and short-term prediction, and the heterogeneity characteristics of the predictions of each model are related to its internal structure. (3) Text mining data can grasp the dynamics of resident consumption in advance, and by analyzing the number of lags in the predictor dataset, the CPI value predicted by the text mining constructed dataset combined with the ATT-LSTM-ATT model can is about 3 weeks earlier than the official release time.

Key words: CPI, resident consumption, LSTM model, attention mechanism, machine learning model

中图分类号: