Since its introduction, Facebook Prophet has attracted positive attention from both classical statisticians and the Bayesian statistics community. The model provides two built-in inference methods: maximum a posteriori estimation using the L-BFGS-B algorithm, and Markov Chain Monte Carlo (MCMC) sampling via the No-U-Turn Sampler (NUTS). While exploring various time-series forecasting problems using Bayesian inference with Prophet, we encountered limitations stemming from the inability to apply alternative inference techniques beyond those provided by default. Additionally, the fluent API design of Facebook Prophet proved insufficiently flexible for implementing our custom modeling ideas. To address these shortcomings, we developed a complete reimplementation of the Prophet model in PyMC, which enables us to extend the base model and evaluate and compare multiple Bayesian inference methods. In this paper, we present our PyMC-based implementation and analyze in detail the implementation of different Bayesian inference techniques. We consider full MCMC techniques, MAP estimation and Variational inference techniques on a time-series forecasting problem. We discuss in details the sampling approach, convergence diagnostics, forecasting metrics as well as their computational efficiency and detect possible issues which will be addressed in our future work.
翻译:自发布以来,Facebook Prophet模型同时受到经典统计学家与贝叶斯统计学界的积极关注。该模型提供两种内置推断方法:基于L-BFGS-B算法的最大后验估计,以及通过No-U-Turn Sampler(NUTS)实现的马尔可夫链蒙特卡洛(MCMC)采样。在使用Prophet进行贝叶斯推断探索各类时间序列预测问题时,我们发现模型存在局限性:无法使用默认方法之外的替代推断技术。此外,Facebook Prophet的流式API设计在实现自定义建模思路时显得灵活性不足。为克服这些缺陷,我们在PyMC中完成了Prophet模型的完整重实现,从而能够扩展基础模型并评估比较多种贝叶斯推断方法。本文展示了基于PyMC的实现方案,并详细分析了不同贝叶斯推断技术的实施过程。我们在时间序列预测问题上考察了完整MCMC技术、最大后验估计以及变分推断技术,深入探讨了采样方法、收敛诊断、预测指标及其计算效率,同时识别出未来工作中需要解决的潜在问题。