当前位置:网站首页>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 .
边栏推荐
- What if the files on the USB flash disk cannot be deleted? Win11 unable to delete U disk file solution tutorial
- 实战:fabric 用户证书吊销操作流程
- Leetcode simple question ring and rod
- 如何快速体验OneOS
- Two stage locking protocol for concurrency control
- Metaverse Ape猿界应邀出席2022·粤港澳大湾区元宇宙和web3.0主题峰会,分享猿界在Web3时代从技术到应用的文明进化历程
- How can easycvr cluster deployment solve the massive video access and concurrency requirements in the project?
- Go语言学习教程(十五)
- Metaverse ape received $3.5 million in seed round financing from negentropy capital
- Overriding equals() & hashCode() in sub classes … considering super fields
猜你喜欢

700. Search in a Binary Search Tree. Sol

Index optimization of performance tuning methodology

Oracle triggers

2022软件测试工程师涨薪攻略,3年如何达到30K

Technology cloud report won the special contribution award for the 10th anniversary of 2013-2022 of the "cloud Ding Award" of the global cloud computing conference

Recovery technology with checkpoints

Alternating merging strings of leetcode simple questions

Wonderful review of the digital Expo | highlight scientific research strength, and Zhongchuang computing power won the digital influence enterprise award

Cobaltstrike builds an intranet tunnel

Navigation day answer applet: preliminary competition of navigation knowledge competition
随机推荐
ESP32 hosted
Leetcode simple question ring and rod
Pinctrl subsystem and GPIO subsystem
Talking about MySQL index
Stored procedures and stored functions
opencv 判断点在多边形内外
Performance monitoring of database tuning solutions
Livelocks and deadlocks of concurrency control
A substring with a length of three and different characters in the leetcode simple question
How to create a thread
Nanjing: full use of electronic contracts for commercial housing sales
a-tree 树的全部展开和收起
Binary tree (II) -- code implementation of heap
Pl/sql basic case
Metaverse Ape猿界应邀出席2022·粤港澳大湾区元宇宙和web3.0主题峰会,分享猿界在Web3时代从技术到应用的文明进化历程
Damn, window in ie open()
南京:全面启用商品房买卖电子合同
thinkphp5.1跨域问题解决
Golang writes the opening chapter of selenium framework
Why does the C# compiler allow an explicit cast between IEnumerable< T> and TAlmostAnything?