时间序列移动平均
时间序列-移动平均 (Time Series - Moving Average)
For a stationary time series, a moving average model sees the value of a variable at time ‘t’ as a linear function of residual errors from ‘q’ time steps preceding it. The residual error is calculated by comparing the value at the time ‘t’ to moving average of the values preceding.
对于固定的时间序列,移动平均模型将时间“ t”处的变量值视为来自其前“ q”个时间步长的残差线性函数。 通过将时间“ t”处的值与先前值的移动平均值进行比较,可以计算出残余误差。
Mathematically it can be written as −
数学上可以写成-
$$y_{t} = c\:+\:\epsilon_{t}\:+\:\theta_{1}\:\epsilon_{t-1}\:+\:\theta_{2}\:\epsilon_{t-2}\:+\:...+:\theta_{q}\:\epsilon_{t-q}\:$$
$$ y_ {t} = c \:+ \:\ epsilon_ {t} \:+ \:\ theta_ {1} \:\ epsilon_ {t-1} \:+ \:\ theta_ {2} \:\ epsilon_ {t-2} \:+ \:... +:\ theta_ {q} \:\ epsilon_ {tq} \:$$
Where‘q’ is the moving-average trend parameter
其中“ q”是移动平均趋势参数
$\epsilon_{t}$ is white noise, and
$ \ epsilon_ {t} $是白噪声,并且
$\epsilon_{t-1}, \epsilon_{t-2}...\epsilon_{t-q}$ are the error terms at previous time periods.
$ \ epsilon_ {t-1},\ epsilon_ {t-2} ... \ epsilon_ {tq} $是先前时间段的误差项。
Value of ‘q’ can be calibrated using various methods. One way of finding the apt value of ‘q’ is plotting the partial auto-correlation plot.
可以使用多种方法来校准“ q”的值。 找到“ q”的合适值的一种方法是绘制局部自相关图。
A partial auto-correlation plot shows the relation of a variable with itself at prior time steps with indirect correlations removed, unlike auto-correlation plot which shows direct as well as indirect correlations, let’s see how it looks like for ‘temperature’ variable of our data.
部分自相关图显示了变量在先前时间步长上与自身之间的关系,其中间接相关性已删除,这与自相关图显示了直接相关性和间接相关性不同,让我们来看一下“温度”变量的样子数据。
显示PACP (Showing PACP)
In [143]:
在[143]中:
from statsmodels.graphics.tsaplots import plot_pacf
plot_pacf(train, lags = 100)
plt.show()
A partial auto-correlation is read in the same way as a correlogram.
以与相关图相同的方式读取部分自相关。
翻译自: https://www.tutorialspoint.com/time_series/time_series_moving_average.htm
时间序列移动平均
本文介绍了时间序列分析中的移动平均模型,详细解释了如何利用该模型预测变量值,通过对比当前值与历史数据的移动平均值计算残差。文中还讨论了如何选择合适的参数q,并展示了使用Python进行部分自相关图绘制的方法。
2221

被折叠的 条评论
为什么被折叠?



