当前位置:网站首页>介紹一下實現建模中可能用到的時間序列預測之線性二次移動平均,Excel的簡單操作
介紹一下實現建模中可能用到的時間序列預測之線性二次移動平均,Excel的簡單操作
2022-06-26 11:12:00 【嚴同學正在努力】
一、線性移動平均法是什麼?
二次移動平均法是對時間序列平均值再進行第二次移動平均,利用第一次移動平均值和第二次移動平均值構成時間序列的最後一個數據為依據建立線性模型進行預測。
1 .主要特點
移動平均對原序列有修勻或平滑的作用,使得原序列的上下波動被削弱了,而且平均的時距項數N越大,對數列的修勻作用越强。
移動平均的項數不宜過大。
2.不足
- 加大移動平均法的期數(即加大n值)會使平滑波動效果更好,但會使預測值對數據實際變動更不敏感;
- 移動平均法要由大量的過去數據的記錄;
3.計算公式
S t 1 = Y t + Y y − 1 + . . . . + Y t − n + 1 n S_t^1=\dfrac{Y_t+Y_y-_1+....+Y_t-_n+_1}{n} St1=nYt+Yy−1+....+Yt−n+1
S t 2 = S t 1 + S t − 1 1 + . . . . . S t − n + 1 1 n S_t^2=\dfrac{S_t^1+S_t-_1^1+.....S_t-_n+_1^1}{n} St2=nSt1+St−11+.....St−n+11
F t + T = a t + b t T F_t+_T=a_t+b_tT Ft+T=at+btT
a t = 2 S t 1 − S t 2 a_t=2S_t^1-S_t^2 at=2St1−St2
b t = 2 n − 1 ( S t 1 − S t 2 ) b_t=\dfrac{2}{n-1}(S_t^1-S_t^2) bt=n−12(St1−St2)
其中 :
S t 1 S_t^1 St1是第一次平均移動的值
S t 2 S_t^2 St2是第二次平均移動的值
二、操作步驟
1. 准備數據
我們引入年份-供水量數據,如圖2.1所示,
2. 進行第一次移動平均
具體操作如圖2.2所示。PS:注意輸出區域的比特置。
得出的結果如圖2.3所示
3. 在第一次移動平均的基礎上進行二次移動平均
如圖2.4所示操作,間隔仍然選擇3,
得出的結果如圖2.5所示
4. 代入公式進行預測
前面我們有公式:
F t + T = a t + b t T F_t+_T=a_t+b_tT Ft+T=at+btT
a t = 2 S t 1 − S t 2 a_t=2S_t^1-S_t^2 at=2St1−St2
b t = 2 n − 1 ( S t 1 − S t 2 ) b_t=\dfrac{2}{n-1}(S_t^1-S_t^2) bt=n−12(St1−St2)
假設我們要預測2022年的供水量,那麼就可以把數據代入公式
a t = 2 ∗ 19274.33 − 18669.67 a_t=2*19274.33-18669.67 at=2∗19274.33−18669.67
b t = 2 3 − 1 ( 19274.33 − 18669.67 ) b_t=\dfrac{2}{3-1}(19274.33-18669.67) bt=3−12(19274.33−18669.67)
F ( 2000 + 20 ) = 2 ∗ 19274.33 − 18669.67 + 2 3 − 1 ( 19274.33 − 18669.67 ) F_(2000+20)=2*19274.33-18669.67+\dfrac{2}{3-1}(19274.33-18669.67) F(2000+20)=2∗19274.33−18669.67+3−12(19274.33−18669.67)
求得F=20483.65
三 總結
以上就是今天要講的內容,本文僅僅簡單介紹了二次移動平均法在Excel的簡單操作,而Excel提供了大量能使我們快速便捷地處理數據的函數和方法。
边栏推荐
猜你喜欢
Machine Learning Clustering - Experimental Report
word中涂黑的方块
That is to say, "live broadcast" is launched! One stop live broadcast service with full link upgrade
MySQL模糊查询详解
JS take the date of the previous month 【 pit filling 】
4、 Stacks and queues
April 13, 2021 interview with beaver family
PC QQ大厅 上传更新 修改versionInfo
机器学习聚类——实验报告
SVN 安装配置
随机推荐
MySQL backup and restore command
机器学习PCA——实验报告
Nacos2.x.x start error creating bean with name 'grpcclusterserver';
MySQL模糊查询详解
Common regular expressions - tool classes (mobile number, email, QQ, fax)
Code specification & explain in detail the functions and uses of husky, prettier, eslint and lint staged
杜比全景音效简介
互联网对抗神器之漏洞扫描与反渗透
【深度学习理论】(7) 长短时记忆网络 LSTM
Splicing full paths and uploading multiple pictures of laravel admin when laravel uses OSS
nacos2.x.x启动报错信息Error creating bean with name ‘grpcClusterServer‘;
动态规划解决股票问题(下)
Fabric.js 上划线、中划线(删除线)、下划线
FasterRCNN
服务器单、双向可调一键互信脚本!
2、 Linear table
机器学习线性回归——实验报告
一键部署属于自己的社区论坛
How does unity prevent other camera positions and rotations from being controlled by steamvrplugin when using steamvrplugin
Recent work report