时间序列移动平均_时间序列-移动平均

本文介绍了时间序列分析中的移动平均模型,详细解释了如何利用该模型预测变量值,通过对比当前值与历史数据的移动平均值计算残差。文中还讨论了如何选择合适的参数q,并展示了使用Python进行部分自相关图绘制的方法。
部署运行你感兴趣的模型镜像
时间序列移动平均

时间序列移动平均

时间序列-移动平均 (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()

Code Snippet 10

A partial auto-correlation is read in the same way as a correlogram.

以与相关图相同的方式读取部分自相关。

翻译自: https://www.tutorialspoint.com/time_series/time_series_moving_average.htm

时间序列移动平均

您可能感兴趣的与本文相关的镜像

Python3.11

Python3.11

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值