In this chapter, we will talk about the techniques involved in exponential smoothing of time series.
在本章中,我们将讨论时间序列的指数平滑所涉及的技术。
Exponential Smoothing is a technique for smoothing univariate time-series by assigning exponentially decreasing weights to data over a time period.
指数平滑是一种通过在一段时间内为数据分配指数递减的权重来平滑单变量时间序列的技术。
Mathematically, the value of variable at time ‘t+1’ given value at time t, y_(t+1|t) is defined as −
数学上,在时间t处给定时间t y_(t + 1 | t)的值在时间“ t + 1”处的变量的值定义为-
$$y_{t+1|t}\:=\:\alpha y_{t}\:+\:\alpha\lgroup1 -\alpha\rgroup y_{t-1}\:+\alpha\lgroup1-\alpha\rgroup^{2}\:y_{t-2}\:+\:...+y_{1}$$
$$ y_ {t + 1 | t} \:= \:\ alpha y_ {t} \:+ \:\ alpha \ lgroup1-\ alpha \ rgroup y_ {t-1} \:+ \ alpha \ lgroup1- \ alpha \ rgroup ^ {2} \:y_ {t-2} \:+ \:... + y_ {1} $$
where,$0\leq\alpha \leq1$ is the smoothing parameter, and
其中, $ 0 \ leq \ alpha \ leq1 $是平滑参数,并且
$y_{1},....,y_{t}$ are previous values of network traffic at times 1, 2, 3, … ,t.
$ y_ {1},....,y_ {t} $是时间1、2、3,...,t的网络流量的先前值。
This is a simple method to model a time series with no clear trend or seasonality. But exponential smoothing can also be used for time series with trend and seasonality.
这是对没有明确趋势或季节性的时间序列建模的简单方法。 但是,指数平滑也可以用于具有趋势和季节性的时间序列。
Triple Exponential Smoothing (TES) or Holt's Winter method, applies exponential smoothing three times - level smoothing $l_{t}$, trend smoothing $b_{t}$, and seasonal smoothing $S_{t}$, with $\alpha$, $\beta^{*}$ and $\gamma$ as smoothing parameters with ‘m’ as the frequency of the seasonality, i.e. the number of seasons in a year.
三重指数平滑(TES)或Holt的Winter方法,应用了三次指数平滑-水平平滑$ l_ {t} $,趋势平滑$ b_ {t} $和季节性平滑$ S_ {t} $,其中$ \ alpha $ ,$ \ beta ^ {** $和$ \ gamma $作为平滑参数,其中'm'为季节性频率,即一年中的季节数。
According to the nature of the seasonal component, TES has two categories −
根据季节性因素的性质,TES有两类:
Holt-Winter's Additive Method − When the seasonality is additive in nature.
Holt-Winter的加法 -当季节性本质上是加法时。
Holt-Winter’s Multiplicative Method − When the seasonality is multiplicative in nature.
Holt-Winter的乘法法 -当季节性本质上是乘法时。
For non-seasonal time series, we only have trend smoothing and level smoothing, which is called Holt’s Linear Trend Method.
对于非季节时间序列,我们只有趋势平滑和水平平滑,这称为Holt线性趋势方法。
Let’s try applying triple exponential smoothing on our data.
让我们尝试对数据应用三重指数平滑。
In [316]:
在[316]中:
from statsmodels.tsa.holtwinters import ExponentialSmoothing
model = ExponentialSmoothing(train.values, trend= )
model_fit = model.fit()
In [322]:
在[322]中:
predictions_ = model_fit.predict(len(test))
In [325]:
在[325]中:
plt.plot(test.values)
plt.plot(predictions_[1:1871])
Out[325]:
出[325]:
[]
Here, we have trained the model once with training set and then we keep on making predictions. A more realistic approach is to re-train the model after one or more time step(s). As we get the prediction for time ‘t+1’ from training data ‘til time ‘t’, the next prediction for time ‘t+2’ can be made using the training data ‘til time ‘t+1’ as the actual value at ‘t+1’ will be known then. This methodology of making predictions for one or more future steps and then re-training the model is called rolling forecast or walk forward validation.
在这里,我们使用训练集对模型进行了一次训练,然后继续进行预测。 一种更现实的方法是在一个或多个时间步长之后重新训练模型。 当我们从训练数据'til time't'得到时间't + 1'的预测时,可以使用训练数据'til time't + 1'作为实际的时间来进行时间't + 2'的下一个预测这样就知道了“ t + 1”的值。 这种对一个或多个未来步骤进行预测,然后重新训练模型的方法称为滚动预测或前瞻性验证。
翻译自: https://www.tutorialspoint.com/time_series/time_series_exponential_smoothing.htm