135 112.94 121.86 114.42 105.92 92.09 80.03 66.23 52.65 45.71 38.24 30.39 24.01 18.34 16.82 15.48 13.88 12.44
时间: 2024-02-10 16:46:31 浏览: 171
智普教育Python培训就业班 150多集Python基础+就业视频教程.txt
好的,给定数据如下:
135 112.94 121.86 114.42 105.92 92.09 80.03 66.23 52.65 45.71 38.24 30.39 24.01 18.34 16.82 15.48 13.88 12.44
现在我们来计算四项移动平均:
首先是一项移动平均,即n=1,每个数据点的移动平均值就是它本身。
接下来是二项移动平均,即n=2,每个数据点的移动平均值为相邻两个数据点的平均值:
(135+112.94)/2=123.97
(112.94+121.86)/2=117.40
(121.86+114.42)/2=118.14
(114.42+105.92)/2=110.17
(105.92+92.09)/2=99.01
(92.09+80.03)/2=86.06
(80.03+66.23)/2=73.13
(66.23+52.65)/2=59.44
(52.65+45.71)/2=49.18
(45.71+38.24)/2=41.98
(38.24+30.39)/2=34.31
(30.39+24.01)/2=27.20
(24.01+18.34)/2=21.18
(18.34+16.82)/2=17.58
(16.82+15.48)/2=16.15
(15.48+13.88)/2=14.68
(13.88+12.44)/2=13.16
接下来是三项移动平均,即n=3,每个数据点的移动平均值为相邻三个数据点的平均值:
(135+112.94+121.86)/3=123.60
(112.94+121.86+114.42)/3=116.07
(121.86+114.42+105.92)/3=114.07
(114.42+105.92+92.09)/3=104.81
(105.92+92.09+80.03)/3=92.68
(92.09+80.03+66.23)/3=79.78
(80.03+66.23+52.65)/3=66.97
(66.23+52.65+45.71)/3=54.53
(52.65+45.71+38.24)/3=45.87
(45.71+38.24+30.39)/3=38.11
(38.24+30.39+24.01)/3=30.55
(30.39+24.01+18.34)/3=24.25
(24.01+18.34+16.82)/3=19.39
(18.34+16.82+15.48)/3=16.55
(16.82+15.48+13.88)/3=15.06
(15.48+13.88+12.44)/3=13.60
最后是四项移动平均,即n=4,每个数据点的移动平均值为相邻四个数据点的平均值:
(135+112.94+121.86+114.42)/4=121.05
(112.94+121.86+114.42+105.92)/4=113.03
(121.86+114.42+105.92+92.09)/4=108.57
(114.42+105.92+92.09+80.03)/4=98.12
(105.92+92.09+80.03+66.23)/4=86.32
(92.09+80.03+66.23+52.65)/4=72.25
(80.03+66.23+52.65+45.71)/4=61.15
(66.23+52.65+45.71+38.24)/4=50.96
(52.65+45.71+38.24+30.39)/4=41.75
(45.71+38.24+30.39+24.01)/4=34.09
(38.24+30.39+24.01+18.34)/4=27.25
(30.39+24.01+18.34+16.82)/4=22.14
(24.01+18.34+16.82+15.48)/4=18.66
(18.34+16.82+15.48+13.88)/4=16.13
(16.82+15.48+13.88+12.44)/4=14.16
可以看出,随着时间窗口大小的增加,趋势平均值的变化更加缓慢,波动也更小。
阅读全文