当前位置:网站首页>介紹一下實現建模中可能用到的時間序列預測之線性二次移動平均,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提供了大量能使我們快速便捷地處理數據的函數和方法。
边栏推荐
猜你喜欢
随机推荐
nacos2.x.x启动报错信息Error creating bean with name ‘grpcClusterServer‘;
QT connection MySQL data query failed
Win10 start FTP service and set login authentication
深度学习中的FLOPs和Params如何计算
Fabric.js 上划线、中划线(删除线)、下划线
SolidWorks rendering tips how not to display edges -- display style settings
MySQL performance monitoring and SQL statements
.net中,日志组件 Nlog,SerialLog, Log4Net的用法
Splicing full paths and uploading multiple pictures of laravel admin when laravel uses OSS
Group by is used in laravel to group and query the quantity
Character sets and comparison rules
代码规范 & 详细解释 husky、prettier、eslint、lint-staged 的作用和使用
在Oracle中update大量数据会不会导致undo空间爆掉
Detailed explanation of MySQL fuzzy query
Moore vote, leetcode169, leetcode229
Laravel writes native SQL statements
Redis的最佳实践?看完不心动,算我输!!
laravel 安装报错 Uncaught ReflectionException: Class view does not exist
JWT certification agreement -- I opened a Yihong hospital
Uncaught reflectionexception: class view does not exist









