当前位置:网站首页>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 .
边栏推荐
- Livelocks and deadlocks of concurrency control
- [Chongqing Guangdong education] National Open University autumn 2018 0088-21t Insurance Introduction reference questions
- Summary of concurrency control
- 50. Pow(x, n). O(logN) Sol
- Concurrency control of performance tuning methodology
- 2022-07-05:给定一个数组,想随时查询任何范围上的最大值。 如果只是根据初始数组建立、并且以后没有修改, 那么RMQ方法比线段树方法好实现,时间复杂度O(N*logN),额外空间复杂度O(N*
- MySQL actual combat 45 lecture learning (I)
- Database tuning solution
- Serializability of concurrent scheduling
- 了解 Android Kotlin 中 DataStore 的基本概念以及为什么应该停止在 Android 中使用 SharedPreferences
猜你喜欢

Pl/sql basic case

Livelocks and deadlocks of concurrency control

The countdown to the launch of metaverse ape is hot

Leetcode simple question check whether all characters appear the same number of times

700. Search in a Binary Search Tree. Sol

How can easycvr cluster deployment solve the massive video access and concurrency requirements in the project?

Metaverse ape received $3.5 million in seed round financing from negentropy capital

Recovery technology with checkpoints

元宇宙中的三大“派系”

Analysis of the problem that the cookie value in PHP contains a plus sign (+) and becomes a space
随机推荐
Two stage locking protocol for concurrency control
解决thinkphp启动时“No input file specified”的问题
Technology cloud report: how many hurdles does the computing power network need to cross?
Solutions for unexplained downtime of MySQL services
Nanjing: full use of electronic contracts for commercial housing sales
航海日答题小程序之航海知识竞赛初赛
509. Fibonacci Number. Sol
Oracle hint understanding
Talking about MySQL index
Oracle views the data size of a table
Sub total of Pico development
Storage optimization of performance tuning methodology
70. Climbing Stairs. Sol
What about data leakage? " Watson k'7 moves to eliminate security threats
Pl/sql basic case
Overview of concurrency control
How to develop and introduce applet plug-ins
等到产业互联网时代真正发展成熟,我们将会看待一系列的新产业巨头的出现
实战:fabric 用户证书吊销操作流程
二叉树(二)——堆的代码实现