当前位置:网站首页>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 about data leakage? " Watson k'7 moves to eliminate security threats
- 2022-07-05:给定一个数组,想随时查询任何范围上的最大值。 如果只是根据初始数组建立、并且以后没有修改, 那么RMQ方法比线段树方法好实现,时间复杂度O(N*logN),额外空间复杂度O(N*
- 如何开发引入小程序插件
- Interview questions for famous enterprises: Coins represent a given value
- 实战:fabric 用户证书吊销操作流程
- QT creator 7-cmake update
- Sparse array [matrix]
- Talking about MySQL index
- 请求二进制数据和base64格式数据的预览显示
- a-tree 树的全部展开和收起
猜你喜欢

Distance from point to line intersection and included angle of line

Overview of concurrency control
![[error record] file search strategy in groovy project (src/main/groovy/script.groovy needs to be used in the main function | groovy script directly uses the relative path of code)](/img/b6/b2036444255b7cd42b34eaed74c5ed.jpg)
[error record] file search strategy in groovy project (src/main/groovy/script.groovy needs to be used in the main function | groovy script directly uses the relative path of code)

boundary IoU 的计算方式

Depth first DFS and breadth first BFS -- traversing adjacency tables

从 1.5 开始搭建一个微服务框架——日志追踪 traceId

Summary of concurrency control

What if the files on the USB flash disk cannot be deleted? Win11 unable to delete U disk file solution tutorial

Navigation day answer applet: preliminary competition of navigation knowledge competition
![[groovy] mop meta object protocol and meta programming (Introduction to groovyobject interface | introduction to metaclass | implementation of class methods using groovyobject invokemethod)](/img/48/cd7960bbbc51a967b20da410bf81fe.jpg)
[groovy] mop meta object protocol and meta programming (Introduction to groovyobject interface | introduction to metaclass | implementation of class methods using groovyobject invokemethod)
随机推荐
Metasploit(msf)利用ms17_010(永恒之蓝)出现Encoding::UndefinedConversionError问题
点到直线的距离直线的交点及夹角
50. Pow(x, n). O(logN) Sol
a-tree 树的全部展开和收起
The countdown to the launch of metaverse ape is hot
[error record] file search strategy in groovy project (src/main/groovy/script.groovy needs to be used in the main function | groovy script directly uses the relative path of code)
Go language learning tutorial (XV)
Metaverse ape received $3.5 million in seed round financing from negentropy capital
Pl/sql basic case
Server optimization of performance tuning methodology
Distance entre les points et les lignes
New 3D particle function in QT 6.3
GWT module may need to be (RE) compiled reduce - GWT module may need to be (RE) compiled reduce
What changes has Web3 brought to the Internet?
boundary IoU 的计算方式
Assign the output of a command to a variable [repeat] - assigning the output of a command to a variable [duplicate]
Wonderful review of the digital Expo | highlight scientific research strength, and Zhongchuang computing power won the digital influence enterprise award
Solutions for unexplained downtime of MySQL services
Character conversion PTA
Go语言学习教程(十五)