当前位置:网站首页>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 .
边栏推荐
- Comment développer un plug - in d'applet
- Post-90s tester: "after joining Ali, this time, I decided not to change jobs."
- Index optimization of performance tuning methodology
- BFC block level formatting context
- database mirroring
- Binary tree (II) -- code implementation of heap
- Damn, window in ie open()
- The countdown to the launch of metaverse ape is hot
- Golang writes the opening chapter of selenium framework
- Pl/sql basic case
猜你喜欢

Server optimization of performance tuning methodology

Damn, window in ie open()

Serializability of concurrent scheduling

科技云报道:算力网络,还需跨越几道坎?

Leetcode simple question: the minimum cost of buying candy at a discount

Leetcode simple question ring and rod

Nanjing: full use of electronic contracts for commercial housing sales

元宇宙中的三大“派系”

database mirroring

Solutions for unexplained downtime of MySQL services
随机推荐
Database recovery strategy
Pl/sql basic syntax
Summary of concurrency control
Three "factions" in the metauniverse
Overriding equals() & hashCode() in sub classes … considering super fields
Draw a red lantern with MATLAB
Nanjing: full use of electronic contracts for commercial housing sales
Distance entre les points et les lignes
Alternating merging strings of leetcode simple questions
boundary IoU 的计算方式
科技云报道荣膺全球云计算大会“云鼎奖”2013-2022十周年特别贡献奖
Promql demo service
What if the files on the USB flash disk cannot be deleted? Win11 unable to delete U disk file solution tutorial
FBO and RBO disappeared in webgpu
Storage optimization of performance tuning methodology
Metaverse Ape获Negentropy Capital种子轮融资350万美元
数据泄露怎么办?'华生·K'7招消灭安全威胁
Sub total of Pico development
CA certificate trampled pit
Analysis of the problem that the cookie value in PHP contains a plus sign (+) and becomes a space