c++ 时间序列工具包
When it comes to time series forecasting, I’m a great believer that the simpler the model, the better.
关于时间序列预测,我坚信模型越简单越好。
However, not all time series are created equal. Some time series have a strongly defined trend — we often see this with economic data, for instance:
但是,并非所有时间序列都是相同的。 某些时间序列具有明确定义的趋势-例如,我们经常在经济数据中看到这一趋势:
Others show a more stationary-like pattern — e.g. monthly air passenger numbers:
其他人则表现出更平稳的模式,例如每月的航空旅客人数:
The choice of time series model will depend highly on the type of time series one is working with. Here are some of the most useful time series models I’ve encountered.
时间序列模型的选择将在很大程度上取决于正在使用的时间序列的类型。 这是我遇到的一些最有用的时间序列模型。
1. ARIMA (1. ARIMA)
In my experience, ARIMA tends to be most useful when modelling time series with a strong trend. The model is also adept at modelling seasonality patterns.
以我的经验,当对具有强烈趋势的时间序列进行建模时,ARIMA往往最有用。 该模型还擅长对季节性模式进行建模。
Let’s take an example.
让我们举个例子。
Suppose we wish to model monthly air passenger numbers over a period of years. The original data is sourced from San Francisco Open Data.
假设我们希望对几年内的每月航空旅客数量进行建模。 原始数据来自San Francisco Open Data 。
Such a time series will have a seasonal component (holiday seasons tend to have higher passenger numbers, for instance) as well as evidence of a trend as indicated when the series is decomposed as below.
这样的时间序列将具有季节性成分(例如,假日季节往往会有更高的乘客人数),以及当序列分解如下时所指示的趋势的证据。