您的浏览器禁用了JavaScript(一种计算机语言,用以实现您与网页的交互),请解除该禁用,或者联系我们。[国际货币基金组织]:辅助宏框架预测的python包:概念和示例 - 发现报告

辅助宏框架预测的python包:概念和示例

2025-08-29国际货币基金组织高***
AI智能总结
查看更多
辅助宏框架预测的python包:概念和示例

A Python Package toAssist MacroframeworkForecasting Concepts and Examples Sakai Ando, Shuvam Das, Sultan Orazbayev WP/25/172 IMF Working Papersdescribe research inprogress by the author(s) and are published toelicit comments and to encourage debate.The views expressed in IMF Working Papers arethose of the author(s) and do not necessarilyrepresent the views of the IMF, its Executive Board,or IMF management. 2025AUG IMF Working PaperResearch Department A Python Package to Assist Macroframework Forecasting: Concepts and ExamplesPrepared bySakai Ando, Shuvam Das, and Sultan Orazbayev* Authorized for distribution byEmine BozAugust 2025 IMF Working Papersdescribe research in progress by the author(s) and are published to elicitcomments and to encourage debate.The views expressed in IMF Working Papers are those of theauthor(s) and do not necessarily represent the views of the IMF, its Executive Board, or IMF management. ABSTRACT:In forecasting economic time series, statistical models often need to be complemented withaprocess to impose variousconstraintsin a smooth manner.Systematicallyimposingconstraintsand retainingsmoothness are important but challenging.Ando (2024) proposes a systematic approach, but a user-friendlypackage to implementithas not been developed.This paper addresses this gap by introducing a Pythonpackage,macroframe-forecast, that allows users to generate forecaststhatarebothsmooth over time andconsistent with user-specified constraints.We demonstrate the package’s functionality with two examplesaboutforecastingUS GDP and fiscal variables. RECOMMENDED CITATION:Ando, Sakai, Shuvam Das, and Sultan Orazbayev (2025),“A Python Package toAssist Macroframework Forecasting: Concepts and Examples,”IMF Working Paper. A Python Package to AssistMacroframework Forecasting Concepts and Examples Prepared by Sakai Ando, Shuvam Das, Sultan Orazbayev 1.Introduction In forecasting economic time series, statistical models often need to be supplemented with procedures thatimpose constraints whilepreserving smoothnessover time. For example, GDP forecasts generated usingmodels such as autoregressions or decision trees may not align with the long-term growth rates anticipated byforecasters. In such cases, forecasters aim to adjust the time series so that it convergessmoothlyto thedesired long-term growth path. However, ad hoc constraint imposition,such as manually alteringonlytheterminal valuein a long time series,can introduce undesirable discontinuitiesbetween the penultimate andterminal values.Similar challenges arise when forecasting aggregate variables and their subcomponents, suchas fiscal balance, revenue, and expenditure. Relying solely on statistical models may fail to ensure thatforecasts satisfy accounting identity constraints, and imposing these constraints in an ad hoc manner,such astreating one variable as a residual,can result in forecasts that lack the desired smoothnesssince the residualvariableabsorbs the forecasterrorsof the rest.In general,adjustingthe forecasts to satisfy constraintsoftenbreaksthe smoothness, and vice versa. Systematically imposing constraints while retaining smoothness is importantbutchallenging. Constraints oftenstem from accounting identities and expert judgment, making their incorporation essential forinternalconsistency. Smoothness is equally critical, as optimal forecasts typically exhibit less volatility than historicaldata. For instance, in a random walk, historical data are volatile, but the optimal forecast is constant over time,equal to the last observed value. Achieving both objectives manually is resource-intensive,especially whendealing with numerous variables and constraints,raisingthe question of how to systematically imposeconstraints and smoothness. Ando (2024)proposesasystematic approach to impose constraints andmaintainsmoothness, but a user-friendly package to implementithas not been developed. Buildingon the forecast reconciliation literature,notablyreviewed by Athanasopoulos et al. (2024)andthe smoothing method of Hodrick and Prescott (1997),Ando (2024)definesa quadraticprogrammingproblem thatcan impose both the constraints and temporalsmoothness in a close form, applicable to a large system of time series.Ando (2024)thenprovidesthreeexamples toillustratehow to combine statistical models withtheproposed smooth reconciliation method, a laAndo and Kim (2023).AlthoughAndo(2024) providesthereplication code for the examples used in the paper,auser-friendlypackage to implement the method remains agap. Existingpackages in R and Pythonassistforecast reconciliation and smoothing separatelybut not jointly. Forinstance, thehts(Hyndman et al.,2021)andFoReco(Girolimetto andDiFonzo, 2023)packages in Rsupportreconciliation,but the reconciled forecast may not be smooth over time.This is also the caseforhierarchicalforecast(Olivares et al., 2024)packagein Python.On the other hand,packages,such assmooth(Svetunkov, 2024)and forecast(Hyndman et al.,2024)for Ran