当前位置:网站首页>Exponential weighted average and its deviation elimination
Exponential weighted average and its deviation elimination
2022-07-05 22:27:00 【ShadyPi】
Exponentially weighted average
For a data set in the form of sequence , A method of statistics and obtaining continuous curves is exponential weighted average . In particular , For a data sequence
θ 1 , θ 2 , ⋯ , θ m \theta_1,\theta_2,\cdots,\theta_m θ1,θ2,⋯,θm
If you connect these points directly , The resulting curve will contain a lot of noise , Messy and irregular :
So let's recalculate the value of each point , Make
v 0 = 0 v 1 = β v 0 + ( 1 − β ) θ 1 ⋯ v i = β v i − 1 + ( 1 − β ) θ i ⋯ v m = β v m − 1 + ( 1 − β ) θ m v_0=0\\ v_1=\beta v_0+(1-\beta)\theta_1\\ \cdots\\ v_i=\beta v_{i-1}+(1-\beta)\theta_i\\ \cdots\\ v_m=\beta v_{m-1}+(1-\beta)\theta_m\\ v0=0v1=βv0+(1−β)θ1⋯vi=βvi−1+(1−β)θi⋯vm=βvm−1+(1−β)θm
Through this averaging method , We are actually right 1 ∼ i 1\sim i 1∼i The data are weighted average , And the weight is from i i i To 1 1 1 Decreasing exponentially , The closer to the current index, the higher the weight . An empirical estimate is v i v_i vi Probably represents the former 1 1 − β \frac{1}{1-\beta} 1−β1 Average the data , Because the weight of samples beyond this range has been relatively small .
Parameters β \beta β What affects is the decay rate of the weight of the previous samples , β \beta β The closer the 1, The slower the sample weight decays , The more samples we include , At this time, the curve will be smoother , But it cannot reflect the effect of the current point in time , It usually lags behind . and KaTeX parse error: Undefined control sequence: \bata at position 1: \̲b̲a̲t̲a̲ The closer the 0, The faster the sample weight decays , The curve will fluctuate more violently , But it is very sensitive to current data , The response is very prompt .
The following figure for β = 0.9 \beta=0.9 β=0.9( Red ) and β = 0.98 \beta=0.98 β=0.98( green ) When we get the curve :
Deviation elimination
in application , The curve we get actually deviates a little from the curve in the figure above , If β = 0.98 \beta=0.98 β=0.98, What we actually get should be the purple line :
This is because in the early stage of index weighted average , Our initial value v 0 = 0 v_0=0 v0=0 It also occupies a great weight , The front end of the curve is pulled down , Until the middle and later stages of the curve , v 0 v_0 v0 The weight attenuation of is low enough , The purple line gradually coincides with the green line .
To avoid this , You can add another term to the previous operation , obtain
v i = β v i − 1 + ( 1 − β ) θ i 1 − β i v_i=\frac{\beta v_{i-1}+(1-\beta)\theta_i}{1-\beta^i} vi=1−βiβvi−1+(1−β)θi
Because the initial item v 0 = 0 v_0=0 v0=0 stay v i v_i vi The weight of is β i \beta^i βi, So divide by 1 − β i 1-\beta^i 1−βi You can rule out v 0 v_0 v0 The impact , Get a reasonable curve .
边栏推荐
- Platformio create libopencm3 + FreeRTOS project
- 南京:全面启用商品房买卖电子合同
- Implementation technology of recovery
- [Chongqing Guangdong education] National Open University autumn 2018 0088-21t Insurance Introduction reference questions
- 如何开发引入小程序插件
- 科技云报道:算力网络,还需跨越几道坎?
- Performance monitoring of database tuning solutions
- Character conversion PTA
- Navigation day answer applet: preliminary competition of navigation knowledge competition
- Qtquick3d real time reflection
猜你喜欢
Stored procedures and stored functions
Win11运行cmd提示“请求的操作需要提升”的解决方法
笔记本电脑蓝牙怎么用来连接耳机
Distributed resource management and task scheduling framework yarn
U盘的文件无法删除文件怎么办?Win11无法删除U盘文件解决教程
2022软件测试工程师涨薪攻略,3年如何达到30K
科技云报道荣膺全球云计算大会“云鼎奖”2013-2022十周年特别贡献奖
Implementation technology of recovery
Business learning of mall commodity module
Technology cloud report: how many hurdles does the computing power network need to cross?
随机推荐
Sparse array [matrix]
Performance testing of software testing
Comment développer un plug - in d'applet
When the industrial Internet era is truly mature, we will look at the emergence of a series of new industrial giants
EasyCVR集群部署如何解决项目中的海量视频接入与大并发需求?
Draw a red lantern with MATLAB
FBO and RBO disappeared in webgpu
[groovy] mop meta object protocol and meta programming (Introduction to groovyobject interface | introduction to metaclass | implementation of class methods using groovyobject invokemethod)
2022软件测试工程师涨薪攻略,3年如何达到30K
Two stage locking protocol for concurrency control
Common interview questions of redis factory
Record several frequently asked questions (202207)
Calculation method of boundary IOU
Golang writes the opening chapter of selenium framework
Distance entre les points et les lignes
Form artifact
MySQL服务莫名宕机的解决方案
请求二进制数据和base64格式数据的预览显示
Metaverse Ape猿界应邀出席2022·粤港澳大湾区元宇宙和web3.0主题峰会,分享猿界在Web3时代从技术到应用的文明进化历程
Talking about MySQL index