其中S(t)、T(t)、R(t)分别是周期成分(seasonal component)、趋势成分(trend-cycle component)、残差成分(remainder component)。
The additive decomposition is the most appropriate if the magnitude of the seasonal fluctuations, or the variation around the trend-cycle, does not vary with the level of the time series. When the variation in the seasonal pattern, or the variation around the trend-cycle, appears to be proportional to the level of the time series, then a multiplicative decomposition is more appropriate. Multiplicative decompositions are common with economic time series.
经典的时间序列分界演算法,起于1920年,直到1950年之前仍在广泛使用。经典演算法步骤相对简单,同时也是很多其他分解演算法的基础。经典分解法是假设周期性成分在每个周期内都是相同的(【例如每年的月周期成分都相同】)。
其中m=2k+1,亦即时刻t的移动平均的值为向前k个值和向后k个值的均值。
(1)加性模型分解演算法
Step1 :如果m为偶数,则用2m-MA【感觉这里似乎有点问题,搜了几个资料,都是说2 m,m是偶数,2m还是偶数,不知道这里目的是什么?】来计算序列的趋势成分T(t);如果m为奇数,则用m-MA来计算序列的趋势成分T(t)。
Step2 :计算去掉趋势的时间序列 D(t)=y(t)-T(t)。
Step3 :为了估计周期成分,只需要对同一周期的数据取均值即可。例如对于月度数据,要计算三月的周期性成分,对所有D(t)中的三月份的数据进行求均值即可。周期性成分会被调整(加上一个偏置)以使得它们的和为0。对周期性成分复制到D(t)的长度,即得到D(t)的所有周期性成分,记作S(t)。
Step4 :残差成分R(t)=y(t)-T(t)-S(t)。
(2)乘性模型分解演算法
乘性模型和加性模型的思想很类似,区别在于把上述加性模型的Step2改成D(t)=y(t)/T(t),Step4改成 R(t)=y(t)/(T(t)*S(t))。
3. X11分解法(X11 decomposition)
另外一个受人欢迎的季度性数据和月度数据的分解演算法是 X11分解法,它发明于美国人口普查局和加拿大统计局。
这方法是基于经典分解法的,但是包括很多其他的步骤和特点来客服经典分解法的一些不足。特别的,所有的数据点的趋势成分都可以得到(【经典分解法最开始和最后的部分数据无法计算得到移动平均值】),周期成分允许随著时间变化。X11有一些 复杂的方法来处理交易日、假期、一些已知的影响因素的影响。它同时处理了加性模型和乘性模型。这个过程是全自动的,而且对于时间序列中的异常值和数据平平变动很鲁棒。
X11方法的细节可以参考 Dagum, E. B., & Bianconcini, S. (2016). Seasonal adjustment methods and real time trend-cycle estimation. Springer 。R中有现成的程序可以使用。
4. SEATS分解(SEATS decomposition)
「SEATS」是指「Seasonal Extraction in ARIMA Time Series」。这个方法是由西班牙银行开发 的,现在被广泛应用在各国的政府部门中。这个演算法只是针对季度性和月度数据。因此天级数据、小时级数据或者周数据,需要其他的方法。
详细的演算法过程请参考 Dagum, E. B., & Bianconcini, S. (2016). Seasonal adjustment methods and real time trend-cycle estimation. Springer. R中的seasonal包中有程序介面可以使用。
5. STL分解(STL decomposition)
STL是时间序列分解的一种versatile和鲁棒的方法。它是「Seasonal and Trend decomposition using Loess」的缩写,其中Loess是一种鲁棒的回归演算法。
详细内容请参考 Cleveland, R. B., Cleveland, W. S., McRae, J. E., & Terpenning, I. J. (1990). STL: A seasonal-trend decomposition procedure based on loess. Journal of Official Statistics, 6(1), 3–33.
6. 序列中趋势成分和周期成分的强度
时间序列分解可以用来衡量序列中的趋势成分和周期成分的强度。以分解公式 y(t)=T(t)+S(t)+R(t), 为例。
上式中,如果趋势性越强,Var(T(t)+R(t))会比Var(R(t))大得多,因此上式会很大,当然被限制在[0,1]之间。因此可以用上式来衡量趋势的强度。同理,下式可以用来衡量周期的强度,它也在[0,1]之内。
推荐阅读: